MLIB
Loading...
Searching...
No Matches
log.cpp File Reference

Implementation of syslog functions. More...

#include <mlib/mlib.h>
#include <psapi.h>
#include <stdio.h>
#include <utf8/utf8.h>

Data Structures

struct  LOG
 

Macros

#define _WINSOCK_DEPRECATED_NO_WARNINGS
 
#define LOG_DGRAM_SIZE   1024
 
#define SERVER_INI_KEY   "LogServername"
 
#define FILE_INI_KEY   "LogFilename"
 
#define FLAGS_INI_KEY   "LogOptions"
 
#define PRI_INI_KEY   "LogPriorityMask"
 
#define DEFAULT_FLAGS   0
 
#define DEFAULT_PRIMASK   0xff
 
#define DEFAULT_SERVERNAME   "localhost"
 
#define DEFAULT_FACILITY   LOG_USER
 

Functions

void openlog (const char *ident, int option, int facility)
 Open connection to logger.
 
void closelog ()
 closelog also resets the identification string for syslog messages back to the default, if openlog was called with a non-NULL argument to ident.
 
void syslog (int facility_priority, const char *fmt,...)
 Generate a log message using FMT string and option arguments.
 
bool syslog_debug (const char *fmt,...)
 Generate a log message at debug level using FMT string and option arguments.
 
int setlogmask (int mask)
 The setlogmask() function sets this logmask for the current process, and returns the previous mask.
 
int setlogopt (int opt)
 Set option flags.
 

Variables

int log_defaultopt = DEFAULT_FLAGS
 Default log options - combination of LOGOPT_... flags.
 
int log_defaultmask = DEFAULT_PRIMASK
 
char log_servhostname [_MAX_PATH] = {DEFAULT_SERVERNAME}
 Destination host for UDP datagrams. Default is "localhost".
 
char log_fname [_MAX_PATH]
 Log filename if LOGOPT_FILE flag is set.
 

Detailed Description

Implementation of syslog functions.