![]() |
KSquare Utilities
|
Used for logging messages. More...
#include <RunLog.h>
Public Member Functions | |
| RunLog () | |
| Creates an instance were logging will go to the console. More... | |
| RunLog (const char *_fileName) | |
| Creates instance with a log messages written to file 'fileName'. More... | |
| RunLog (const KKStr &_fileName) | |
| Creates instance with a log messages written to file 'fileName'. More... | |
| RunLog (std::ostream &errorLogStream) | |
| Creates instance where logging messages are written to file stream specified by 'errorLogStream'. More... | |
| RunLog (std::ostream *logStream) | |
| Creates instance where logging messages are written to file stream pointed to by 'logStream'. More... | |
| RunLog (MsgQueuePtr _msgQueue) | |
| ~RunLog () | |
| void | Append (const char *str) |
| Appends string to log; generally used by other Log methods but can be called by public. More... | |
| void | AttachFile (const KKStr &_fileName) |
| Call this method to start logging messages to a different file. More... | |
| void | AttachFile (std::ostream &_logFile) |
| Call this method to start logging messages to a specific file stream. More... | |
| void | AttachFileAppend (const KKStr &_fileName) |
| Call this method to start appending logging messages to a different file. More... | |
| void | AttachMsgQueue (MsgQueuePtr _msgQueue) |
| All activity that is written to the log file will be added as messages to '_msgQueue'. More... | |
| void | DetachFile () |
| Closes out current log file and starts writing to stdout aka 'cout'. More... | |
| KKStr | FileName () |
| void | Flush () |
| const KKStr & | LastLine () |
| Returns the last line of text written to the log file. More... | |
| RunLog & | Level (kkint32 _level) |
| kkint32 | Level () const |
| kkint32 | LineCount () const |
| kkint32 | MemoryConsumedEstimated () const |
| RunLog & | operator<< (bool right) |
| RunLog & | operator<< (kkint16 right) |
| RunLog & | operator<< (kkuint16 right) |
| RunLog & | operator<< (kkint32 right) |
| RunLog & | operator<< (kkuint32 right) |
| RunLog & | operator<< (kkint64 right) |
| RunLog & | operator<< (kkuint64 right) |
| RunLog & | operator<< (double right) |
| RunLog & | operator<< (char right) |
| RunLog & | operator<< (const char *right) |
| RunLog & | operator<< (const KKStr &right) |
| RunLog & | operator<< (KKStrConstPtr right) |
| RunLog & | operator<< (const VectorKKStr &right) |
| RunLog & | operator<< (std::ostream &(*mf)(std::ostream &)) |
| void | SetLevel (kkint32 _level) |
| void | SetLoggingLevel (kkint32 _loggingLevel) |
| void | WriteLine (const KKStr &s) |
| Writes a line of text to log file; does not check logging level; and does not write any preview text such as DateTime or processId. More... | |
| void | WriteLine (const char *s) |
| Writes a line of text to log file; does not check logging level; and does not write any preview text such as DateTime or processId. More... | |
Used for logging messages.
Has facilities to deal with different levels of logging. You use the normal insertion operators to write to this object. You can specify at any point a Logging level. If this level is less than or equal to a specified threshold the message will be recorded in the log. <br > The idea is that during normal production runs log level would be set to 10. But if there appears to be some issue then you would set the logging level to a higher level to get more details. The higher the level the more detail you will get.
| RunLog::RunLog | ( | ) |
Creates an instance were logging will go to the console.
Definition at line 32 of file RunLog.cpp.
Referenced by KKB::Application::Application(), and KKMLL::FactoryFVProducer::RegisterFactory().
| RunLog::RunLog | ( | const char * | _fileName | ) |
Creates instance with a log messages written to file 'fileName'.
Definition at line 44 of file RunLog.cpp.
References KKB::KKStr::operator=().
| RunLog::RunLog | ( | const KKStr & | _fileName | ) |
Creates instance with a log messages written to file 'fileName'.
Definition at line 57 of file RunLog.cpp.
References KKB::KKStr::operator=().
| RunLog::RunLog | ( | std::ostream & | errorLogStream | ) |
Creates instance where logging messages are written to file stream specified by 'errorLogStream'.
Definition at line 70 of file RunLog.cpp.
References KKB::KKStr::operator=().
| RunLog::RunLog | ( | std::ostream * | logStream | ) |
Creates instance where logging messages are written to file stream pointed to by 'logStream'.
Definition at line 83 of file RunLog.cpp.
References KKB::KKStr::operator=().
| RunLog::RunLog | ( | MsgQueuePtr | _msgQueue | ) |
Definition at line 96 of file RunLog.cpp.
| RunLog::~RunLog | ( | ) |
summary> Sets current message level you would normally call this method just before you wish to start logging a message. If you are not changing the level since previous call then no need to call. /summary>
Definition at line 108 of file RunLog.cpp.
| void RunLog::Append | ( | const char * | str | ) |
Appends string to log; generally used by other Log methods but can be called by public.
Definition at line 253 of file RunLog.cpp.
References KKB::GlobalGoalKeeper::EndBlock(), Flush(), KKB::operator<<(), KKB::osGetThreadId(), and KKB::GlobalGoalKeeper::StartBlock().
Referenced by Level(), operator<<(), and WriteLine().
| void RunLog::AttachFile | ( | const KKStr & | _fileName | ) |
Call this method to start logging messages to a different file.
Will close out current log file and open new one specified by 'fileName'.
Definition at line 127 of file RunLog.cpp.
References KKB::KKStr::operator=().
Referenced by KKB::Application::InitalizeApplication().
| void RunLog::AttachFile | ( | std::ostream & | _logFile | ) |
Call this method to start logging messages to a specific file stream.
Will close out current log file and write to the specified '_logFile' in the future.
Definition at line 166 of file RunLog.cpp.
References KKB::KKStr::operator=().
| void RunLog::AttachFileAppend | ( | const KKStr & | _fileName | ) |
Call this method to start appending logging messages to a different file.
Will close out current log file and open new one specified by 'fileName' with the append flag set.
Definition at line 143 of file RunLog.cpp.
References KKB::KKStr::operator=().
| void RunLog::AttachMsgQueue | ( | MsgQueuePtr | _msgQueue | ) |
All activity that is written to the log file will be added as messages to '_msgQueue'.
Definition at line 159 of file RunLog.cpp.
| void RunLog::DetachFile | ( | ) |
Closes out current log file and starts writing to stdout aka 'cout'.
Definition at line 181 of file RunLog.cpp.
References KKB::KKStr::operator=().
| KKStr RunLog::FileName | ( | ) |
Definition at line 193 of file RunLog.cpp.
| void RunLog::Flush | ( | ) |
Definition at line 296 of file RunLog.cpp.
Referenced by Append().
|
inline |
Definition at line 220 of file RunLog.cpp.
References Append().
Referenced by KKMLL::TrainingProcess2::BuildTrainingProcess().
|
inline |
|
inline |
| kkint32 RunLog::MemoryConsumedEstimated | ( | ) | const |
Definition at line 116 of file RunLog.cpp.
| RunLog & RunLog::operator<< | ( | bool | right | ) |
Definition at line 305 of file RunLog.cpp.
References Append().
Definition at line 317 of file RunLog.cpp.
References Append(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::operator=(), KKB::KKStr::Str(), and KKB::StrFormatInt().
Definition at line 327 of file RunLog.cpp.
References Append(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::operator=(), KKB::KKStr::Str(), and KKB::StrFormatInt().
Definition at line 337 of file RunLog.cpp.
References Append(), KKB::KKStr::AppendInt32(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), and KKB::KKStr::Str().
Definition at line 347 of file RunLog.cpp.
References Append(), KKB::KKStr::AppendUInt32(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), and KKB::KKStr::Str().
Definition at line 357 of file RunLog.cpp.
References Append(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::operator=(), KKB::KKStr::Str(), and KKB::StrFormatInt64().
Definition at line 367 of file RunLog.cpp.
References Append(), KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::operator=(), KKB::KKStr::Str(), and KKB::StrFormatInt64().
| RunLog & RunLog::operator<< | ( | double | right | ) |
Definition at line 377 of file RunLog.cpp.
References Append().
| RunLog & RunLog::operator<< | ( | char | right | ) |
Definition at line 393 of file RunLog.cpp.
References Append().
| RunLog & RunLog::operator<< | ( | const char * | right | ) |
Definition at line 404 of file RunLog.cpp.
References Append().
Definition at line 412 of file RunLog.cpp.
References Append(), and KKB::KKStr::Str().
| RunLog & RunLog::operator<< | ( | KKStrConstPtr | right | ) |
Definition at line 420 of file RunLog.cpp.
References Append(), and KKB::KKStr::Str().
| RunLog & RunLog::operator<< | ( | const VectorKKStr & | right | ) |
Definition at line 429 of file RunLog.cpp.
| RunLog& KKB::RunLog::operator<< | ( | std::ostream &(*)(std::ostream &) | mf | ) |
|
inline |
| void RunLog::SetLoggingLevel | ( | kkint32 | _loggingLevel | ) |
Definition at line 211 of file RunLog.cpp.
| void RunLog::WriteLine | ( | const KKStr & | s | ) |
Writes a line of text to log file; does not check logging level; and does not write any preview text such as DateTime or processId.
If there is any data in Current-Line it will be write out first before writing this line of text.
Definition at line 453 of file RunLog.cpp.
References KKB::MsgQueue::AddMsg(), Append(), KKB::KKStr::Empty(), KKB::GlobalGoalKeeper::EndBlock(), KKB::KKStr::operator=(), and KKB::GlobalGoalKeeper::StartBlock().
| void RunLog::WriteLine | ( | const char * | s | ) |
Writes a line of text to log file; does not check logging level; and does not write any preview text such as DateTime or processId.
If there is any data in Current-Line it will be write out first before writing this line of text.
Definition at line 479 of file RunLog.cpp.
References KKB::MsgQueue::AddMsg(), Append(), KKB::KKStr::Empty(), KKB::GlobalGoalKeeper::EndBlock(), KKB::KKStr::operator=(), and KKB::GlobalGoalKeeper::StartBlock().