libcommonc++  0.7
Log Class Reference

Logging routines. More...

#include <Log.h++>

Static Public Member Functions

static void setFileLogFormat (const String &format)
 Set the log format to be used when logging to a file. More...
 
static void setConsoleLogFormat (const String &format)
 Set the log format to be used when logging to the console. More...
 
static void setUseConsoleLog (bool flag)
 Enable or disable logging to the console. More...
 
static void setFileLogger (FileLogger *logger)
 Set the FileLogger object to use for logging to a file. More...
 
static FileLoggergetFileLogger ()
 Get the FileLogger currently in use for logging to a file. More...
 
static void setConsoleLogger (ConsoleLogger *logger)
 Set the ConsoleLogger object to use for logging to the console. More...
 
static ConsoleLoggergetConsoleLogger ()
 Get the ConsoleLogger currently in use for logging to the console. More...
 
static void setUseFileLog (bool flag)
 Enable or disable logging to a file. More...
 
static void setLogFile (const String &dir, const String &name)
 Set the directory and base name for log files. More...
 
static void setLogFileMaxSize (size_t maxLogSize)
 Set the maximum size for log files. More...
 
static void setLogFileRotateCount (uint_t rotateCount)
 Set the rotation log file count. More...
 
static void vlogFile (LogLevel level, const char *file, int line, const char *message, va_list args)
 Write a log message to the log file, if file logging is enabled. More...
 
static void vlogConsole (LogLevel level, const char *file, int line, const char *message, va_list args)
 Write a log message to the console, if console logging is enabled. More...
 

Friends

class LogFunctor
 

Detailed Description

Logging routines.

Also see the macros Log_debug(), Log_info(), Log_warning(), and Log_error().

Author
Mark Lindner

Member Function Documentation

◆ getConsoleLogger()

static ConsoleLogger* getConsoleLogger ( )
inlinestatic

Get the ConsoleLogger currently in use for logging to the console.

◆ getFileLogger()

static FileLogger* getFileLogger ( )
inlinestatic

Get the FileLogger currently in use for logging to a file.

◆ setConsoleLogFormat()

void setConsoleLogFormat ( const String format)
static

Set the log format to be used when logging to the console.

Parameters
formatThe log format.

◆ setConsoleLogger()

void setConsoleLogger ( ConsoleLogger logger)
static

Set the ConsoleLogger object to use for logging to the console.

Any current ConsoleLogger object will be deleted. The passed in object must be heap allocated, and should never be freed by the caller.

◆ setFileLogFormat()

void setFileLogFormat ( const String format)
static

Set the log format to be used when logging to a file.

Parameters
formatThe log format.

◆ setFileLogger()

void setFileLogger ( FileLogger logger)
static

Set the FileLogger object to use for logging to a file.

Any current FileLogger object will be deleted. The passed in object must be heap allocated, and should never be freed by the caller.

◆ setLogFile()

void setLogFile ( const String dir,
const String name 
)
static

Set the directory and base name for log files.

Parameters
dirThe directory in which the log file(s) will be created.
nameThe base name for the log file(s).

◆ setLogFileMaxSize()

void setLogFileMaxSize ( size_t  maxLogSize)
static

Set the maximum size for log files.

Parameters
maxLogSizeThe maximum log file size, in kilobytes.

◆ setLogFileRotateCount()

void setLogFileRotateCount ( uint_t  rotateCount)
static

Set the rotation log file count.

Parameters
rotateCountThe maximum number of backlog files to create. The value must range from 0 to 9, with 0 indicating that log rotation is disabled.

◆ setUseConsoleLog()

static void setUseConsoleLog ( bool  flag)
inlinestatic

Enable or disable logging to the console.

Parameters
flagtrue if logging to the console should be enabled, false otherwise.

◆ setUseFileLog()

static void setUseFileLog ( bool  flag)
inlinestatic

Enable or disable logging to a file.

Parameters
flagtrue if logging to a file should be enabled, false otherwise.

◆ vlogConsole()

void vlogConsole ( LogLevel  level,
const char *  file,
int  line,
const char *  message,
va_list  args 
)
static

Write a log message to the console, if console logging is enabled.

◆ vlogFile()

void vlogFile ( LogLevel  level,
const char *  file,
int  line,
const char *  message,
va_list  args 
)
static

Write a log message to the log file, if file logging is enabled.

Friends And Related Function Documentation

◆ LogFunctor

friend class LogFunctor
friend

The documentation for this class was generated from the following files: