Public Types
Log Class Reference

Logging class. More...

List of all members.

Public Types

enum  LogPriority {
  DEBUG = 1,
  INFO,
  NOTICE,
  WARNING,
  ERROR,
  CRITICAL
}

Low Level Methods

bool SetFile (string filename, bool append=true)
 Sets the specified file as log file.
bool IsOpen ()
 Check if log file is open.
void SetPriority (int priority)
 Set lowest priority that will get logged.
void SetMBPriority (int priority)
 Set lowest priority that will get message boxed.
void Print (string message)
 Log a message without priority checking.
void Debug (string message)
 Log a message with debug priority.
void Info (string message)
 Log a message with info priority.
void Notice (string message)
 Log a message with notice priority.
void Warning (string message)
 Log a message with warning priority.
void Error (string message)
 Log a message with error priority.
void Critical (string message)
 Log a message with critical priority.
void Log (int priority, string message)
 Log a message with the specified priority.

Detailed Description

Logging class.


Member Enumeration Documentation

Log priority levels to determine the log output.

Enumerator:
DEBUG 

Log priority to output all messages.

INFO 

Log priority to output all messages that have info priority or higher.

NOTICE 

Log priority to output all messages that have notice priority or higher.

WARNING 

Log priority to output all messages that have warning priority or higher.

ERROR 

Log priority to output all error messages.

CRITICAL 

Log priority to output only critical error messages.


Constructor & Destructor Documentation

void Log::Log ( int  priority,
string  message 
)

Log a message with the specified priority.

Parameters:
priorityThe priority of this log message.
messageThe string to write to the log file.

Member Function Documentation

bool Log::SetFile ( string  filename,
bool  append = true 
)

Sets the specified file as log file.

Parameters:
filenameName of the file to put log messages
append
  • true to append data at the end of the file.
  • false to erase the content of the file if it already exists.
void Log::SetMBPriority ( int  priority)

Set lowest priority that will get message boxed.

If priority is larger then no message box will be displayed.

void Log::Print ( string  message)

Log a message without priority checking.

Parameters:
messageThe string to write to the log file.
void Log::Debug ( string  message)

Log a message with debug priority.

Parameters:
messageThe string to write to the log file.
void Log::Info ( string  message)

Log a message with info priority.

Parameters:
messageThe string to write to the log file.
void Log::Notice ( string  message)

Log a message with notice priority.

Parameters:
messageThe string to write to the log file.
void Log::Warning ( string  message)

Log a message with warning priority.

Parameters:
messageThe string to write to the log file.
void Log::Error ( string  message)

Log a message with error priority.

Parameters:
messageThe string to write to the log file.
void Log::Critical ( string  message)

Log a message with critical priority.

Parameters:
messageThe string to write to the log file.