A class for managing log messages.
More...
#include <BCLog.h>
List of all members.
Public Types |
enum | LogLevel {
debug,
detail,
summary,
warning,
error,
nothing
} |
Public Member Functions |
| BCLog () |
| ~BCLog () |
Static Public Member Functions |
static BCLog::LogLevel | GetLogLevelFile () |
static BCLog::LogLevel | GetLogLevelScreen () |
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) |
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) |
Static Private Attributes |
static const char * | fVersion = VERSION |
static BCLog::LogLevel | fMinimumLogLevelFile = BCLog::debug |
static BCLog::LogLevel | fMinimumLogLevelScreen = BCLog::summary |
static std::ofstream | fOutputStream |
static bool | fFirstOutputDone = false |
static int | fHindex = 0 |
Detailed Description
A class for managing log messages.
Copyright (C) 2008-2012, Daniel Kollar and Kevin Kroeninger. All rights reserved.
For the licensing terms see doc/COPYING.
- 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 28 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
- Enumerator:
debug |
|
detail |
|
summary |
|
warning |
|
error |
|
nothing |
|
Definition at line 44 of file BCLog.h.
{debug, detail, summary, warning, error, nothing};
Constructor & Destructor Documentation
Constructor.
Definition at line 33 of file BCLog.cxx.
{
gErrorIgnoreLevel=2000;
}
Member Function Documentation
void BCLog::CloseLog |
( |
|
) |
[static] |
Closes the log file
Definition at line 90 of file BCLog.cxx.
static int BCLog::GetHIndex |
( |
|
) |
[inline, static] |
- Returns:
- unique number for use in histogram name string
Definition at line 156 of file BCLog.h.
Returns the minimum log level for file output.
- Returns:
- log level
Definition at line 61 of file BCLog.h.
Returns the minimum log level for screen output.
- Returns:
- log level
Definition at line 67 of file BCLog.h.
static const char* BCLog::GetVersion |
( |
|
) |
[inline, static] |
- Returns:
- string containing the version number
Definition at line 151 of file BCLog.h.
bool BCLog::IsOpen |
( |
|
) |
[static] |
- Returns:
- true if log file is open or false if not.
Definition at line 83 of file BCLog.cxx.
void BCLog::OpenLog |
( |
const char * |
filename |
) |
[static] |
void BCLog::OpenLog |
( |
|
) |
[static] |
Opens log file and sets minimum log levels for file and screen output.
- Parameters:
-
| filename | log filename |
| loglevelfile | minimum log level for file output |
| loglevelscreen | minimum log level for screen output |
Definition at line 46 of file BCLog.cxx.
Writes string to the file and screen log if the log level is equal or greater than the minimum
- Parameters:
-
| loglevelfile | loglevel for the current message |
| loglevelscreen | loglevel for the current message |
| message | string to write to the file and screen log |
Definition at line 97 of file BCLog.cxx.
void BCLog::Out |
( |
const char * |
message |
) |
[static] |
static void BCLog::Out |
( |
BCLog::LogLevel |
loglevel, |
|
|
const char * |
message | |
|
) |
| | [inline, static] |
Definition at line 127 of file BCLog.h.
{ Out(loglevel,loglevel,message); };
static void BCLog::OutDebug |
( |
const char * |
message |
) |
[inline, static] |
static void BCLog::OutDetail |
( |
const char * |
message |
) |
[inline, static] |
static void BCLog::OutError |
( |
const char * |
message |
) |
[inline, static] |
static void BCLog::OutSummary |
( |
const char * |
message |
) |
[inline, static] |
static void BCLog::OutWarning |
( |
const char * |
message |
) |
[inline, static] |
Sets the minimum log level for file and screen output.
- Parameters:
-
| loglevelscreen | log level for screen |
| loglevelfile | log level for file |
Definition at line 88 of file BCLog.h.
static void BCLog::SetLogLevel |
( |
BCLog::LogLevel |
loglevel |
) |
[inline, static] |
Sets the minimum log level for file and screen output.
- Parameters:
-
Definition at line 94 of file BCLog.h.
static void BCLog::SetLogLevelFile |
( |
BCLog::LogLevel |
loglevel |
) |
[inline, static] |
Sets the minimum log level for file output.
- Parameters:
-
Definition at line 75 of file BCLog.h.
static void BCLog::SetLogLevelScreen |
( |
BCLog::LogLevel |
loglevel |
) |
[inline, static] |
Sets the minimum log level for screen output.
- Parameters:
-
Definition at line 81 of file BCLog.h.
void BCLog::StartupInfo |
( |
|
) |
[static] |
Writes startup information onto screen and into a logfile
Definition at line 125 of file BCLog.cxx.
Converts a log level to a string
Definition at line 148 of file BCLog.cxx.
{
switch (loglevel)
{
case debug:
return "Debug ";
case detail:
return "Detail ";
case summary:
return "Summary";
case warning:
return "Warning";
case error:
return "Error ";
default:
return "";
}
}
Member Data Documentation
Specifies wheather there were output printouts already
Definition at line 183 of file BCLog.h.
Global histogram counter
Definition at line 187 of file BCLog.h.
The minimum file log level
Definition at line 171 of file BCLog.h.
The minimum screen log level
Definition at line 175 of file BCLog.h.
The output stream for the file log
Definition at line 179 of file BCLog.h.
BAT version number
Definition at line 167 of file BCLog.h.
The documentation for this class was generated from the following files: