|
QSDK 1.1 Documentation |
#include <Q/dpf.h>
Inheritance diagram for Utils::Log:

Public Member Functions | |
| bool | enabled () const |
| bool | enabled (unsigned int category) const |
| int | level () const |
| int | level (unsigned int category) const |
| unsigned int | verbosity () const |
| unsigned int | verbosity (unsigned int category) const |
| Logger * | logger (MessageClass cls) const |
| void | setLevel (int level) |
| void | setLevel (unsigned int category, int level) |
| void | setEnabled (bool enabled) |
| void | setEnabled (unsigned int category, bool enabled) |
| void | setVerbosity (unsigned int verbosity) |
| void | setVerbosity (unsigned int category, unsigned int verbosity) |
| void | setLogger (Logger *logger) |
| void | setLogger (MessageClass cls, Logger *logger) |
| const char * | getCategory (unsigned int cat) |
| void | resetLogStats () |
| void | logStats (unsigned int &errors, unsigned int &warnings, unsigned int &infos, unsigned int &debugs) |
| unsigned int | getCategory (const char *name, int level, bool enabled) |
| unsigned int | getCategory (const char *name, int level, bool enabled, unsigned int verbosity) |
| unsigned int | getCategory (const char *name) |
| void | print (MessageClass cls, unsigned int category, int level, const char *file, unsigned int line, const char *format,...) |
| void | vprint (MessageClass cls, unsigned int category, int level, const char *file, unsigned int line, const char *format, const va_list &args) |
| void | print (MessageClass cls, const char *category, int level, const char *file, unsigned int line, const char *format,...) |
| void | vprint (MessageClass cls, const char *category, int level, const char *file, unsigned int line, const char *format, const va_list &args) |
| bool | willPrint (MessageClass cls, unsigned int category, int level) |
| bool | willPrint (MessageClass cls, const char *category, int level) |
Static Public Member Functions | |
| Log * | theLog () |
| Logger::REF | theDefaultLogger () |
For efficiency, categories are represented by small positive integers. New categories can be created by calling getCategory() with the name of the category and any initial state for the category. If the initial state is not specified, the log maintains a set of global defaults for initialising new categories.
Each category has 3 variables associated with it:
0 debug[1]|foo|Message 1 debug[1]|foo|file.cpp:1234|Message 2 debug[1]|foo|file.cpp:1234|<time>|<taskid>|Message
Informational, Warning and Error messages are logged at levels -1, -2 and -3 respectively and to avoid confusion in this case, the messages are prefixed with "info", "warning" or "error" and the level is omitted.
Each message also has a message class. The message class is defined by enumerated type Utils::MessageClass.
The logging system can be further controlled by configuration settings (using the Registry on Windows, or a text file on Unix). The settings may be edited using the supplied utility QSettings.
|
|
|
|
|
Returns the default enabled flag for new categories |
|
|
Return the name of a category if it exists or zero otherwise. |
|
|
Find or create the category with the given name. If it doesn't exist it is created with the given initial state (or the current default state where appropriate). |
|
||||||||||||||||||||
|
Find or create the category with the given name. If it doesn't exist it is created with the given initial state (or the current default state where appropriate). |
|
||||||||||||||||
|
Find or create the category with the given name. If it doesn't exist it is created with the given initial state (or the current default state where appropriate). |
|
|
Returns the log level of a specified |
|
|
Returns the default log level for new categories. |
|
|
Returs the current logger used for the given MessageClass. |
|
||||||||||||||||||||
|
Return the number of messages logged in the various message classes. |
|
||||||||||||||||||||||||||||||||
|
Print a message with the given class, category and level. The values passed for file and line should be the filename and line number of the code printing the message. The message itself is specified as a printf-like format string and a variable list of arguments. |
|
||||||||||||||||||||||||||||||||
|
Print a message with the given class, category and level. The values passed for file and line should be the filename and line number of the code printing the message. The message itself is specified as a printf-like format string and a variable list of arguments. |
|
|
Clear the current counters of messages logged. |
|
||||||||||||
|
Set the enabled flag on |
|
|
Set both the default enabled flag for new categories and the enabled flag on all existing categories. |
|
||||||||||||
|
Set the log level of |
|
|
Set both the default log level for new categories and the log level of all existing categories. |
|
||||||||||||
|
Set the logging channel for messages of the given class. Messages sent to the log are formatted and then passed onto the configured logger, allowing applications to implement custom loggers to fit status messages into their own user interface, for instance. |
|
|
Set the logging channel for all categories. Messages sent to the log are formatted and then passed onto the configured logger, allowing applications to implement custom loggers to fit status messages into their own user interface, for instance. |
|
||||||||||||
|
Set the verbosity level for |
|
|
Set both the default verbosity level for new categories and the verbosity level of all existing categories. |
|
|
Return the default logging channel. |
|
|
Return the single global instance of the Log. |
|
|
Returns the verbosity level of a |
|
|
Returns the default verbosity level for new categories |
|
||||||||||||||||||||||||||||||||
|
Print a message with the given class, category and level. The values passed for file and line should be the filename and line number of the code printing the message. The message itself is specified as a printf-like format string and a variable list of arguments. |
|
||||||||||||||||||||||||||||||||
|
Print a message with the given class, category and level. The values passed for file and line should be the filename and line number of the code printing the message. The message itself is specified as a printf-like format string and a variable list of arguments. |
|
||||||||||||||||
|
Return true if a message with the given category and level would be printed. |
|
||||||||||||||||
|
Return true if a message with the given category and level would be printed. |
|
|
|
Qube Software Limited © 2000-2004
|
|