#include <nglLog.h>
The nglLog class is a simple facility to manage event logging or simple debugging. A nglLog object can have :
Domains let you easily classify the events in your application : if you follow some simple guidelines, you will be able to tune very precisely which messages you want to log and their given verbose level.
NGL programs have an application log which is always created at startup and used internally by NGL to report errors and other useful informations. Have a look at nglApplication::GetLog() and nglApplication::ParseDefaultArgs() to see how this facility can help you.
Public Types | |
| typedef uint | StampFlags |
Public Member Functions | |
Life cycle | |
| nglLog (bool UseConsole=true) | |
| virtual | ~nglLog () |
Formatting flags | |
| void | SetFlags (StampFlags Flags) |
| StampFlags | GetFlags () |
Output selection | |
| void | UseConsole (bool Use) |
| bool | AddOutput (nglOStream *pStream) |
| bool | DelOutput (nglOStream *pStream) |
Domain management | |
| uint | GetLevel (const nglChar *pDomain) |
| void | SetLevel (const nglChar *pDomain, uint Level) |
Output methods | |
| void | Log (const nglChar *pDomain, uint Level, const nglChar *pText,...) |
| void | Logv (const nglChar *pDomain, uint Level, const nglChar *pText, va_list Args) |
| void | Dump (uint Level=0) const |
Static Public Attributes | |
| static const StampFlags | NoStamp |
| static const StampFlags | TimeStamp |
| static const StampFlags | DateStamp |
| static const StampFlags | DomainStamp |
|
|
|
|
|
|
|
|
Flush all pending events and clos all current outputs. |
|
|
Add an output stream
|
|
|
Remove an output stream
|
|
|
Dumps domain usage statistics using
|
|
|
Get current output flags.
|
|
|
Get the verbose level from a domain name
|
|
||||||||||||||||||||
|
Log an event
The message Trailing newlines are automaticaly removed, and multiples lines message have each of their lines properly stamped. |
|
||||||||||||||||||||
|
Log an event
|
|
|
Set output flags.
|
|
||||||||||||
|
Set the verbose level of a domain
pDomain is set to "all", Level will be applied to all known domains and used as the default verbose level for yet unknown domains. |
|
|
Send log output to the application's console.
|
|
|
Add a date stamp (YY/MM/DD format).
|
|
|
Add a domain stamp (domain:).
|
|
|
Do not stamp log lines (raw output).
|
|
|
Add a time stamp (HH:MM:SS format).
|
1.4.1