NetSurf
|
Go to the source code of this file.
Macros | |
#define | NETSURF_LOG_LEVEL INFO |
#define | NSLOG_LVL(level) NSLOG_LEVEL_ ## level |
#define | NSLOG_EVL(level) NSLOG_LVL(level) |
#define | NSLOG_COMPILED_MIN_LEVEL NSLOG_EVL(NETSURF_LOG_LEVEL) |
#define | LOG_FN "" |
#define | LOG_LN __LINE__ |
#define | NSLOG(catname, level, logmsg, args...) |
Typedefs | |
typedef bool() | nslog_ensure_t(FILE *fptr) |
Ensures the FILE handle is available to write logging to. More... | |
Enumerations | |
enum | nslog_level { NSLOG_LEVEL_DEEPDEBUG = 0 , NSLOG_LEVEL_DEBUG = 1 , NSLOG_LEVEL_VERBOSE = 2 , NSLOG_LEVEL_INFO = 3 , NSLOG_LEVEL_WARNING = 4 , NSLOG_LEVEL_ERROR = 5 , NSLOG_LEVEL_CRITICAL = 6 } |
Functions | |
nserror | nslog_init (nslog_ensure_t *ensure, int *pargc, char **argv) |
Initialise the logging system. More... | |
void | nslog_finalise (void) |
Shut down the logging system. More... | |
nserror | nslog_set_filter (const char *filter) |
Set the logging filter. More... | |
nserror | nslog_set_filter_by_options (void) |
Set the logging filter according to the options. More... | |
void | nslog_log (const char *file, const char *func, int ln, const char *format,...) __attribute__((format(printf |
Variables | |
bool | verbose_log |
flag to enable verbose logging More... | |
#define NSLOG | ( | catname, | |
level, | |||
logmsg, | |||
args... | |||
) |
#define NSLOG_COMPILED_MIN_LEVEL NSLOG_EVL(NETSURF_LOG_LEVEL) |
typedef bool() nslog_ensure_t(FILE *fptr) |
enum nslog_level |
void nslog_finalise | ( | void | ) |
Shut down the logging system.
Shuts down the logging subsystem, resetting to verbose logging and output to stderr. Note, if logging is done after calling this, it will be sent to stderr without filtering.
Definition at line 299 of file log.c.
References logfile, NSLOG, and verbose_log.
Referenced by main(), nsgtk_finalise(), and WinMain().
nserror nslog_init | ( | nslog_ensure_t * | ensure, |
int * | pargc, | ||
char ** | argv | ||
) |
Initialise the logging system.
Sets up everything required for logging. Processes the argv passed to remove the -v switch for verbose logging. If necessary ensures the output file handle is available.
Definition at line 190 of file log.c.
References logfile, utsname::machine, netsurf_version, utsname::nodename, NSERROR_INIT_FAILED, NSERROR_NOT_FOUND, NSERROR_OK, NSLOG, nslog_set_filter(), utsname::release, utsname::sysname, uname(), verbose_log, and utsname::version.
Referenced by gui_init_replicant(), main(), nsgtk_init(), and WinMain().
void nslog_log | ( | const char * | file, |
const char * | func, | ||
int | ln, | ||
const char * | format, | ||
... | |||
) |
nserror nslog_set_filter | ( | const char * | filter | ) |
Set the logging filter.
Compiles and enables the given logging filter.
Definition at line 181 of file log.c.
References NSERROR_OK.
Referenced by nslog_init(), and nslog_set_filter_by_options().
nserror nslog_set_filter_by_options | ( | void | ) |
Set the logging filter according to the options.
Definition at line 289 of file log.c.
References nslog_set_filter(), nsoption_charp, and verbose_log.
Referenced by nsoption_validate().
|
extern |
flag to enable verbose logging
Definition at line 31 of file log.c.
Referenced by deskmenu_update(), main(), menu_vlog(), nslog_finalise(), nslog_init(), nslog_log(), nslog_set_filter_by_options(), and plot_init().