In file /home/eternity/Source/Common/LogFile/H/logFile.h:

class LogFile

Log file

Inheritance:

LogFile


Public Methods

LogFile::LogFile (const char *name)
Log file constructor
int LogFile::SetDebugOptions (int options)
Change what is logged in log file
void LogFile::WriteString (LogLevel logLevel, char *format, ...)
Write message to log file
void LogFile::WriteStringVA (LogLevel logLevel, char *format, va_list args)
Write message to log file
LogFile::~LogFile ()
Log file destructor

Public

methods
LogFile (const char *name)
create log called name
int SetDebugOptions (int options)
set what to log xor-ed log levels
virtual void WriteString (LogLevel logLevel, char *format, ...)
Print to log
virtual void WriteStringVA (LogLevel logLevel, char *format, va_list args)
Print to log

Protected

attributes
map > debugMessages
Descriptions for types of messages
char* fileName
Where to write all the messages
int debugOptions
What to write

Documentation

Log file. class that encapsulates file for logging debug messages. Has the ability to log just certain types of messages.
attributes

map > debugMessages
Descriptions for types of messages

char* fileName
Where to write all the messages

int debugOptions
What to write

methods

LogFile(const char *name)
create log called name

int SetDebugOptions(int options)
set what to log xor-ed log levels

virtual void WriteString(LogLevel logLevel, char *format, ...)
Print to log

virtual void WriteStringVA(LogLevel logLevel, char *format, va_list args)
Print to log

LogFile::LogFile(const char *name)
Log file constructor. Opens the specified file for appending and writes start of session in there.

Also sets initial debug options.

Parameters:
name - Log file name.
Author:
Venca
See Also:
~LogFile(), LogLevel

int LogFile::SetDebugOptions(int options)
Change what is logged in log file. Sets debug options = what should be logged. Accepts any combination of logLevels. Returns old value of debug options.
Returns:
Old value of debug options.
Parameters:
options - Log levels that should be logged ored together.
Author:
Venca
See Also:
WriteString(), Debugable

void LogFile::WriteString(LogLevel logLevel, char *format, ...)
Write message to log file. Writes a string to log file if its logLevel matches debugOptions of the log file.

Also prepends time. Every log entry is on separate line.

Returns:
void
Parameters:
logLevel - log level of message - warning, error ...
format - format string similar to printf()
... - Additional variables we want to print
Author:
Venca
See Also:
Debugable, printf(), LogLevel

void LogFile::WriteStringVA(LogLevel logLevel, char *format, va_list args)
Write message to log file. Writes a string to log file if its logLevel matches debugOptions of the log file.

Also prepends time. Every log entry is on separate line.

Returns:
void
Parameters:
logLevel - log level of message - warning, error ...
format - format string similar to printf()
args - Additional variables we want to print
Author:
Venca
See Also:
Debugable, printf(), LogLevel

LogFile::~LogFile()
Log file destructor. Writes end of session to log file and closes log file.
Author:
Venca
See Also:
LogLevel


This class has no child classes.
Author:
Venca
See Also:
LogLevel, Debugable

alphabetic index hierarchy of classes


generated by doc++