Functions | |
void | MLogInit (int level, int nr, int nvr, int nc, int nvc, const char *fname) |
Sets the log level, log window geometry and log filename. | |
void | MLog (int level, const char *fmt,...) |
Prints a formatted log string in the log window (and the log file if enabled). | |
void | MMaskedLog (int level, CARD32 mask, const char *fmt,...) |
Prints a formatted log string in the log window using the context mask. | |
void | MLogSetLevel (int level) |
Sets the current log-level. | |
void | MLogSetMask (CARD32 mask) |
Sets the current log mask. | |
CARD32 | MLogGetMask (void) |
Retrieves the current log mask containing enabled log contexts. | |
void | MLogSetMaskBits (CARD32 mask) |
Adds bits to the current log mask enabling more log contexts. | |
void | MLogResetMaskBits (CARD32 mask) |
Clears bits in the current log mask disabling some log contexts. | |
void | Trace (const char *fmt,...) |
Prints a low level tracing message to the trace file. | |
void | MSetTraceFileName (const char *fname) |
void | MLogSetTimeFormat (const char *strftime_format) |
Enables/disables automatic timestamps in log outputs. | |
void | MTraceSetTimeFormat (const char *strftime_format) |
Enables/disables automatic timestamps in trace outputs. |
MGUI provides a run time log printing both to a window and optionally to a file. Logging is filtered using a threshold level and an optional context mask. By default the context mask is disabled.
A lower level tracing to file is also supported for debugging.
|
Prints a formatted log string in the log window (and the log file if enabled). You can call this function anywhere in your MGUI program, provided your calling method belongs to a class that inherits from CmMGUI.
|
|
Retrieves the current log mask containing enabled log contexts.
|
|
Sets the log level, log window geometry and log filename. All log requests, made later by the program and having a level lower than the one provided as the first parameter, are ignored.
|
|
Clears bits in the current log mask disabling some log contexts. The current log mask is obtained by 'and-ing' the old mask with the negated new one specified as argument.
|
|
Sets the current log-level.
|
|
Sets the current log mask. The old mask is replaced by the new one specified as argument.
|
|
Adds bits to the current log mask enabling more log contexts. The old mask is or-ed with the new one specified as argument.
|
|
Enables/disables automatic timestamps in log outputs.
|
|
Prints a formatted log string in the log window using the context mask. You can call this function anywhere in your MGUI program, provided your calling method belongs to a class that inherits from CmMGUI. The log string is actually printed only if conditions for both the log-level and the context mask are satisfied.
|
|
Sets the name of the file which to write low level tracing messages.
|
|
Enables/disables automatic timestamps in trace outputs.
|
|
Prints a low level tracing message to the trace file. Messages printed via this function are not directed to the log window. Rather they go directly to the trace file (default name is trace.log) created in the current directory of the program. The trace file is open, written and closed at any call to this function, so it's recommended to use it only for low level debugging in case the MLog() function is not suitable.
|