All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::Log Class Reference

Provides logging sevices for the application. More...

#include <Radiant/Log.hpp>

Static Public Member Functions

static void log (const char *str,...)
 Saves a log message to the file. More...
 
static bool setLogFile (const char *logfile)
 Sets the log file. More...
 
static bool setTimedLogFile (const char *prefix)
 Open a log file, with opening time-stamp as part of the file-name. More...
 

Detailed Description

Provides logging sevices for the application.

The logging system is thread-safe, and it is meant for applications to store usage information.

The log mechanism is is not meant for debug output or error messages. For those purposes, see Radiant::info, and Radiant::error.

Member Function Documentation

static void Radiant::Log::log ( const char *  str,
  ... 
)
static

Saves a log message to the file.

When forming the log messages, it makes sense to have them formatted so that it is easier to parse them automatically later on.

Parameters
strmessage
static bool Radiant::Log::setLogFile ( const char *  logfile)
static

Sets the log file.

Parameters
logfilelog filename
Returns
This function true if the the new log file was opened successfully, and false if opening failed.
static bool Radiant::Log::setTimedLogFile ( const char *  prefix)
static

Open a log file, with opening time-stamp as part of the file-name.

Calling setTimedLogFile("foo") will open log file foo-2010-01-04T12-45-12-log.txt, where the numbers present the time in the ISO format.

Parameters
prefixlog file prefix
Returns
true on success