BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCLog Class Reference

A class for managing log messages. More...

#include <BCLog.h>

Public Types

enum  LogLevel {
  debug, detail, summary, warning,
  error, nothing
}
 

Public Member Functions

Constructors and destructors
 BCLog ()
 
 ~BCLog ()
 

Static Public Member Functions

Getters
static BCLog::LogLevel GetLogLevelFile ()
 
static BCLog::LogLevel GetLogLevelScreen ()
 
Setters
static void SetLogLevelFile (BCLog::LogLevel loglevel)
 
static void SetLogLevelScreen (BCLog::LogLevel loglevel)
 
static void SetLogLevel (BCLog::LogLevel loglevelscreen, BCLog::LogLevel loglevelfile)
 
static void SetLogLevel (BCLog::LogLevel loglevel)
 
Miscellaneous
static void OpenLog (const char *filename, BCLog::LogLevel loglevelfile, BCLog::LogLevel loglevelscreen)
 
static void OpenLog (const char *filename)
 
static void OpenLog ()
 
static bool IsOpen ()
 
static void CloseLog ()
 
static void Out (BCLog::LogLevel loglevelfile, BCLog::LogLevel loglevelscreen, const char *message)
 
static void Out (const char *message)
 
static void Out (BCLog::LogLevel loglevel, const char *message)
 
static void OutError (const char *message)
 
static void OutWarning (const char *message)
 
static void OutSummary (const char *message)
 
static void OutDetail (const char *message)
 
static void OutDebug (const char *message)
 
static void StartupInfo ()
 
static const char * GetVersion ()
 
static int GetHIndex ()
 
static const char * ToString (BCLog::LogLevel)
 

Detailed Description

A class for managing log messages.

Author
Daniel Kollar
Kevin Kröninger
Version
1.0
Date
08.2008 This class manages log messages for printing on the screen and into a log file

Definition at line 29 of file BCLog.h.

Member Enumeration Documentation

Enumerator for the amount of details to put into the log file Log levels: debug : Lowest level of information detail : Details of functions, etc. summary : Results warning : Warning messages error : Error message nothing : No output

Definition at line 45 of file BCLog.h.

Constructor & Destructor Documentation

BCLog::BCLog ( )

Constructor.

Definition at line 36 of file BCLog.cxx.

BCLog::~BCLog ( )

Destructor.

Definition at line 44 of file BCLog.cxx.

Member Function Documentation

void BCLog::CloseLog ( )
static

Closes the log file

Definition at line 93 of file BCLog.cxx.

static int BCLog::GetHIndex ( )
inlinestatic
Returns
unique number for use in histogram name string

Definition at line 164 of file BCLog.h.

static BCLog::LogLevel BCLog::GetLogLevelFile ( )
inlinestatic

Returns the minimum log level for file output.

Returns
log level

Definition at line 65 of file BCLog.h.

static BCLog::LogLevel BCLog::GetLogLevelScreen ( )
inlinestatic

Returns the minimum log level for screen output.

Returns
log level

Definition at line 71 of file BCLog.h.

static const char* BCLog::GetVersion ( )
inlinestatic
Returns
string containing the version number

Definition at line 159 of file BCLog.h.

bool BCLog::IsOpen ( )
static
Returns
true if log file is open or false if not.

Definition at line 86 of file BCLog.cxx.

void BCLog::OpenLog ( const char *  filename,
BCLog::LogLevel  loglevelfile,
BCLog::LogLevel  loglevelscreen 
)
static

Opens log file and sets minimum log levels for file and screen output.

Parameters
filenamelog filename
loglevelfileminimum log level for file output
loglevelscreenminimum log level for screen output

Definition at line 49 of file BCLog.cxx.

void BCLog::Out ( BCLog::LogLevel  loglevelfile,
BCLog::LogLevel  loglevelscreen,
const char *  message 
)
static

Writes string to the file and screen log if the log level is equal or greater than the minimum

Parameters
loglevelfileloglevel for the current message
loglevelscreenloglevel for the current message
messagestring to write to the file and screen log

Definition at line 100 of file BCLog.cxx.

static void BCLog::SetLogLevel ( BCLog::LogLevel  loglevelscreen,
BCLog::LogLevel  loglevelfile 
)
inlinestatic

Sets the minimum log level for file and screen output.

Parameters
loglevelscreenlog level for screen
loglevelfilelog level for file

Definition at line 94 of file BCLog.h.

static void BCLog::SetLogLevel ( BCLog::LogLevel  loglevel)
inlinestatic

Sets the minimum log level for file and screen output.

Parameters
loglevellog level

Definition at line 100 of file BCLog.h.

static void BCLog::SetLogLevelFile ( BCLog::LogLevel  loglevel)
inlinestatic

Sets the minimum log level for file output.

Parameters
loglevellog level

Definition at line 81 of file BCLog.h.

static void BCLog::SetLogLevelScreen ( BCLog::LogLevel  loglevel)
inlinestatic

Sets the minimum log level for screen output.

Parameters
loglevellog level

Definition at line 87 of file BCLog.h.

void BCLog::StartupInfo ( )
static

Writes startup information onto screen and into a logfile

Definition at line 128 of file BCLog.cxx.

const char * BCLog::ToString ( BCLog::LogLevel  loglevel)
static

Converts a log level to a string

Definition at line 155 of file BCLog.cxx.


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