![]() |
VR-Forces 4.7 Class Documentation
|
This is a simple class for logging information to a file. More...

Public Types | |
| enum | PrintLevel { Warning = 1, Information = 2, Debug = 4, PrintLevel_End = 5 } |
Public Member Functions | |
| DtDebugLog (const std::string &filename) | |
| default constructor | |
| virtual | ~DtDebugLog () |
| DTOR. | |
| bool | levelWillPrint (DtDebugLog::PrintLevel alevel) |
| Check to see if the provided level would print with the current level. | |
| virtual void | setLevel (DtDebugLog::PrintLevel alevel) |
| Set the output level. | |
| virtual void | setOutputStream (DtOutputStream *stream) |
| Set the output stream. | |
| virtual DtDebugLog::PrintLevel | level () |
| Get the output level. | |
| std::ostream & | out (DtDebugLog::PrintLevel level=DtDebugLog::Information) |
| Get the log output. | |
| DtOutputStream * | outputStream () |
| Get the output stream. | |
Protected Attributes | |
| PrintLevel | myLevel |
| variable used to decide whether send output to the 'works always' stream (myOutput) or the 'works never' stream (myEmptyOutput) | |
| DtFilePrinter * | myFilePrinter |
| The file printer to log to. | |
| DtOutputStreamBuffer * | myBuffer |
| The buffer used by the output stream. | |
| DtOutputStreamBuffer * | myEmptyBuffer |
| The buffer used by the empty output stream. | |
| int | myPrintLevelThresholdRef |
| The dummy 'global notify level' that our DtOutputStream's will compare their configured thresholds to. | |
| DtOutputStream * | myOutput |
| The output stream that does all the work. | |
| std::ostream * | myEmptyOutput |
| The 'black hole' output stream When the stream is created, its threshold is set to myPrintLevelThresholdRef+1 so its always greater than the reference, making it a 'works never' output stream. | |
This is a simple class for logging information to a file.
To be used, the caller must specify a logging level as well as a global logging level. If the threshold is < the globalThreshold, then the output logger will output the specified information to the associated file, if the file was created successfully.
If the filename is reset at any point, then the currently open file is closed and a new file is opened with the specified name.
| makVrv::DtDebugLog::DtDebugLog | ( | const std::string & | filename | ) |
default constructor
|
virtual |
DTOR.
|
inline |
Check to see if the provided level would print with the current level.
References makVrv::vrvTacticalGraphicUtilities::level().
|
virtual |
Set the output level.
|
virtual |
Set the output stream.
|
virtual |
Get the output level.
|
inline |
Get the log output.
References makVrv::vrvTacticalGraphicUtilities::level().
| DtOutputStream* makVrv::DtDebugLog::outputStream | ( | ) |
Get the output stream.
|
protected |
variable used to decide whether send output to the 'works always' stream (myOutput) or the 'works never' stream (myEmptyOutput)
|
protected |
The file printer to log to.
|
protected |
The buffer used by the output stream.
|
protected |
The buffer used by the empty output stream.
|
protected |
The dummy 'global notify level' that our DtOutputStream's will compare their configured thresholds to.
We arbitrarily set this to 0 in the constructor, but it can be any int, really (except MAXINT, because we need to have one value higher than it).
|
protected |
The output stream that does all the work.
When the stream is created, its threshold is set to myPrintLevelThresholdRef so its always less than or equal to it, making it a 'works always' output stream.
|
protected |
The 'black hole' output stream When the stream is created, its threshold is set to myPrintLevelThresholdRef+1 so its always greater than the reference, making it a 'works never' output stream.