#include <stdio.h>
#include <time.h>
#include "xetpan-types.h"
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | XETPAN_LOG_FILE "xetpan.log" |
#define | XETPAN_LOG_FILE_BAK "xetpan.log~" |
#define | SIZE_OF_TIME_STRING 9 |
#define | A_LOGGING_ERROR() |
#define | A_LOGGING_SYSTEM_ERROR() |
#define | A_LOGGING_INFO() |
#define | A_LOGGING_DEBUG() |
#define | A_LOGGING_TRACE |
Functions | |
int | a_Logging_redirect (XetPan *xetpan, const char *path) |
Variables | |
int | verbose |
|
Value: ({if (verbose > 1) \ fprintf(stderr, "%s:%d %s: ",__FILE__ , __LINE__ , __FUNCTION__), \ fprintf(stderr, __VA_ARGS__), \ fprintf(stderr, "\n");}) |
|
Value: ({char ts[SIZE_OF_TIME_STRING]; \ time_t t; \ t = time(NULL); \ strftime(ts, SIZE_OF_TIME_STRING, "%H:%M:%S", localtime(&t)); \ fprintf(stderr, "[%s] ERROR: ", ts); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n");}) |
|
Value: ({if (verbose) \ { \ char ts[SIZE_OF_TIME_STRING]; \ time_t t; \ t = time(NULL); \ strftime(ts, SIZE_OF_TIME_STRING, "%H:%M:%S", localtime(&t)); \ fprintf(stderr, "[%s] ", ts); \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n");} \ } ) |
|
Value: ({fprintf(stderr, "%s (%s +%d) SYSTEM ERROR: ", __FUNCTION__, __FILE__, __LINE__), \ fprintf(stderr, __VA_ARGS__), \ fprintf(stderr, "\n");}) |
|
Value: ({if (verbose > 1) \ fprintf(stderr,"%s:%d %s \n", __FILE__, __LINE__ , __FUNCTION__);}) |
|
|
|
Log filename. |
|
Log's backup filename |
|
Redirect standard error to a log file. This is done because many GUI application launchers do not show the user the standard error even if the application did not start. Makes a backup of the old log file if it existed.
|
Here is the call graph for this function:
|
Verbosity level. Currently: 0 to be quiet, 1 to be verbose, 2 to help debugging |