FreeNOS
|
Logging class. More...
#include <Log.h>
Public Types | |
enum | Level { Emergency, Alert, Critical, Error, Warning, Notice, Info, Debug } |
Logging level values. More... | |
Public Member Functions | |
Log () | |
Constructor. More... | |
virtual | ~Log () |
Destructor. More... | |
Level | getMinimumLogLevel () |
Get the minimum logging level. More... | |
void | setMinimumLogLevel (Level level) |
Set the minimum logging level. More... | |
void | append (const char *str) |
Append to buffered output. More... | |
void | setIdent (const char *ident) |
Set log identity. More... | |
const char * | getIdent () const |
Retrieve log identify. More... | |
virtual void | terminate () const |
Terminate the program immediately. More... | |
Public Member Functions inherited from WeakSingleton< Log > | |
WeakSingleton (Log *obj) | |
Constructor. More... | |
Protected Member Functions | |
virtual void | write (const char *str)=0 |
Write to the actual output device. More... | |
Private Member Functions | |
void | flush (const bool force=false) |
Flush internal buffer. More... | |
Private Attributes | |
Level | m_minimumLogLevel |
Minimum log level required to log. More... | |
const char * | m_ident |
Identity. More... | |
char | m_outputBuffer [LogBufferSize] |
Output line is stored here until written using write() More... | |
Size | m_outputBufferWritten |
Number of characters written in the output buffer. More... | |
Static Private Attributes | |
static const Size | LogBufferSize = 512 |
Size of the log buffer in bytes. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from WeakSingleton< Log > | |
static Log * | instance () |
Retrieve the instance. More... | |
enum Log::Level |
void Log::append | ( | const char * | str | ) |
Append to buffered output.
str | String to append to buffer |
Definition at line 53 of file Log.cpp.
References flush(), LogBufferSize, m_outputBuffer, and m_outputBufferWritten.
Referenced by Kernel::Kernel(), and operator<<().
|
private |
Flush internal buffer.
This function reads the contents of the internal buffer and writes all available bytes to the actual output device using write().
force | True to always flush, even without newline at the end of the buffer. |
Definition at line 72 of file Log.cpp.
References m_outputBuffer, m_outputBufferWritten, and write().
Referenced by append().
const char * Log::getIdent | ( | ) | const |
Log::Level Log::getMinimumLogLevel | ( | ) |
Get the minimum logging level.
Definition at line 33 of file Log.cpp.
References m_minimumLogLevel.
Referenced by LogLevelFile::read().
void Log::setIdent | ( | const char * | ident | ) |
void Log::setMinimumLogLevel | ( | Log::Level | level | ) |
Set the minimum logging level.
Definition at line 38 of file Log.cpp.
References m_minimumLogLevel.
Referenced by kernel_main(), main(), Application::run(), and LogLevelFile::write().
|
virtual |
|
protectedpure virtual |
|
staticprivate |
|
private |
|
private |
Minimum log level required to log.
Definition at line 194 of file Log.h.
Referenced by getMinimumLogLevel(), and setMinimumLogLevel().
|
private |
|
private |