Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

logger.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* LOGGERFUNCTIONLOG )(const char *s)

Enumerations

enum  LOGGER_LOGTYPE { LoggerTypeConsole, LoggerTypeFile, LoggerTypeSyslog, LoggerTypeFunction }
enum  LOGGER_FACILITY {
  LoggerFacilityAuth = 0, LoggerFacilityDaemon, LoggerFacilityMail, LoggerFacilityNews,
  LoggerFacilityUser
}
enum  LOGGER_LEVEL {
  LoggerLevelEmergency = 0, LoggerLevelAlert, LoggerLevelCritical, LoggerLevelError,
  LoggerLevelWarning, LoggerLevelNotice, LoggerLevelInfo, LoggerLevelDebug
}

Functions

CHIPCARD_API int Logger_Open (const char *ident, const char *file, LOGGER_LOGTYPE logtype, LOGGER_FACILITY facility)
CHIPCARD_API void Logger_Close ()
CHIPCARD_API int Logger_Log (LOGGER_LEVEL priority, const char *s)
CHIPCARD_API void Logger_Enable (int f)
CHIPCARD_API int Logger_IsEnabled ()
CHIPCARD_API void Logger_SetLevel (LOGGER_LEVEL l)
CHIPCARD_API int Logger_GetLevel ()
CHIPCARD_API void Logger_SetIdent (const char *id)
CHIPCARD_API LOGGERFUNCTIONLOG Logger_SetLogFunction (LOGGERFUNCTIONLOG fn)


Typedef Documentation

typedef void(* LOGGERFUNCTIONLOG)(const char *s)
 


Enumeration Type Documentation

enum LOGGER_FACILITY
 

Enumeration values:
LoggerFacilityAuth 
LoggerFacilityDaemon 
LoggerFacilityMail 
LoggerFacilityNews 
LoggerFacilityUser 

enum LOGGER_LEVEL
 

Enumeration values:
LoggerLevelEmergency 
LoggerLevelAlert 
LoggerLevelCritical 
LoggerLevelError 
LoggerLevelWarning 
LoggerLevelNotice 
LoggerLevelInfo 
LoggerLevelDebug 

enum LOGGER_LOGTYPE
 

Enumeration values:
LoggerTypeConsole 
LoggerTypeFile 
LoggerTypeSyslog 
LoggerTypeFunction 


Function Documentation

CHIPCARD_API void Logger_Close  ) 
 

Shuts down logging. Automatically disables logging.

Author:
Martin Preuss<martin@libchipcard.de>

CHIPCARD_API void Logger_Enable int  f  ) 
 

Enables or disables logging.

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
f if 0 then logging is disabled, otherwise it is enabled

CHIPCARD_API int Logger_GetLevel  ) 
 

Returns the current log level.

Author:
Martin Preuss<martin@libchipcard.de>

CHIPCARD_API int Logger_IsEnabled  ) 
 

Checks whether logging is enabled.

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
0 if disabled, 1 otherwise

CHIPCARD_API int Logger_Log LOGGER_LEVEL  priority,
const char *  s
 

Log a message.

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
priority priority of the message
s string to log. This string is cut at all occurences of a newline character thus splitting it into multiple log lines if necessary

CHIPCARD_API int Logger_Open const char *  ident,
const char *  file,
LOGGER_LOGTYPE  logtype,
LOGGER_FACILITY  facility
 

Sets up logging. It automatically enables logging.

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
ident this string is prepended to each message logged to identify the logging program
file name of the file to log to. If this is empty and syslog is available, then all messages are logged via syslog. If syslog is not available, all messages are logged to the console.
logtype how to log (via syslog, to a file, to the console etc)
facility what kind of program the log message comes from

CHIPCARD_API void Logger_SetIdent const char *  id  ) 
 

Set ident string. This string is prepended to every log message and should contain the name of the running program.

Author:
Martin Preuss<martin@libchipcard.de>

CHIPCARD_API void Logger_SetLevel LOGGER_LEVEL  l  ) 
 

Sets the logger level. All messages with a priority up to the given one will be logged, all others will not.

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
l maximum level to be logged

CHIPCARD_API LOGGERFUNCTIONLOG Logger_SetLogFunction LOGGERFUNCTIONLOG  fn  ) 
 

Set logging function. This function is used to log messages in mode LoggerTypeFunction.

Author:
Martin Preuss<martin@libchipcard.de>


Generated on Fri Dec 3 23:10:24 2004 for libchipcard by  doxygen 1.3.9.1