#include "common.h"
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include "logger.h"
#include "buffer.h"
#include "conftable.h"
#include "fileplist.h"
#include "loggerlist.h"
#include "misc.h"
#include "xmalloc.h"
Include dependency graph for logger.c:
Go to the source code of this file.
Data Structures | |
struct | Logger |
internal representation of a Logger object. More... | |
Defines | |
#define | lgGetSrcDescText(src) (((src) <= LOG_SRC_LAST) ? (log_src_info_tab[src][0]) : "unknown source") |
returns a descriptive string corresponding to a log source macro. | |
#define | lgGetSrcConfKey(src) (((src) <= LOG_SRC_LAST) ? (log_src_info_tab[src][1]) : "U") |
returns the conftable key corresponding to a log source macro. | |
#define | lgGetSrcDescMaxLen() (lgGetSrcMaxLen(0)) |
returns the maximum length of the descriptive strings of all log mesg sources. | |
#define | lgGetSrcKeyMaxLen() (lgGetSrcMaxLen(1)) |
returns the maximum length of the contable keys of all log mesg sources. | |
#define | lgGetLvlConfKey(lvl) (((lvl) <= LOG_LVL_LAST) ? log_lvl_info_tab[lvl] : "u") |
returns the conftable key corresponding to a log severity level macro. | |
Functions | |
size_t | lgGetSrcMaxLen (int which) |
returns the maximum length of src desc strings (which=0) or src conf key strings (which=1). | |
size_t | lgGetLvlKeyMaxLen () |
returns the maximum length of the sev. level conf key strings. | |
int | logClose (Logger this) |
internal function: closes the current logfile. returns 0 on success. | |
Logger | logInitStream_int (FILE *log_stream, const char *format, int manage_stream) |
internal function: initialise Logger object from a stream. | |
Logger | logInit (const char *file_name, const char *format) |
opens a new logfile. returns 0 an success. More... | |
Logger | logInitStream (FILE *log_stream, const char *format) |
sets the current logging stream to use the given stream log_stream. More... | |
int | logMessagev (Logger this, const unsigned int origin, const unsigned int severity, const int errno_val, const char *const log_text_format, va_list daten) |
Low level function to write a message into on specific Logger object. May well become an internal function in the near future. | |
int | logTerminate (Logger this) |
terminates a Logger object. More... | |
int | addLogger2List (Logger lgr, int src, int lvl, const char *origin_flags) |
adds a logger to the logger matrix if enabled by the origin_flags. | |
char * | int2str (int i) |
converts an int (-99 <= i <= 999) to a char. More... | |
int | logfilesInit () |
initialises the logging subsystem. More... | |
int | logfilesTerminate () |
shuts down the logging subsystem. More... | |
int | logerr (const unsigned int origin, const unsigned int severity, const int errno_val, const char *const log_text_format,...) |
writes an error message with error code description. More... | |
int | logger (const unsigned int origin, const unsigned int severity, const char *const log_text_format,...) |
writes a generic logging message. More... | |
Variables | |
LoggerList | loggers [7+1][5+1] |
2D matrix of loggers for all sources and severity levels. | |
FilepList | log_streams |
list of all open log streams. |
Definition in file logger.c.
|
converts an int (-99 <= i <= 999) to a char.
Definition at line 636 of file logger.c. Referenced by logfilesInit().
|
|
opens a new logfile. returns 0 an success.
Configures the logger to use file_name as the default logging output stream.
|
|
sets the current logging stream to use the given stream log_stream.
Configures logger to use log_stream as its default output stream.
|
|
terminates a Logger object.
|
|
writes an error message with error code description.
|
|
initialises the logging subsystem.
Definition at line 295 of file logger.c. Referenced by main().
|
|
shuts down the logging subsystem.
Frees all ressources allocated by the logging system and closes all logging streams. Do not use logger or logerr after calling this function!
Definition at line 542 of file logger.c. Referenced by main().
|
|
writes a generic logging message.
|