Logger
IntroductionLogger provides basic logging mechanisms. The desired loglevel and output can be set.
FunctionslogMsgextern void logMsg ( int logLvl, const char *format, ... ); ParametersDiscussionWrites a log message to logOutput with the desired loglevel WARNING: Global variables logLevel and logOutput must be initialized before calling logMsg GlobalslogLevelextern int logLevel; DiscussionGlobal variable logLevel. Can be set anywhere in the program. Represents the current log level. logOutputextern FILE *logOutput; DiscussionGlobal variable logOutput. Can be set anywhere in the program. File pointer to the output of the log messages. Macro Definitions
LOGLEVEL_DEBUGLoglevels determine the amount of log created by the software #define LOGLEVEL_DEBUG 4 DiscussionMore detailed description of what is happening See Also LOGLEVEL_ERRORLoglevels determine the amount of log created by the software #define LOGLEVEL_ERROR 1 DiscussionErrors, which are critcal to program execution will be logged See Also LOGLEVEL_INFOLoglevels determine the amount of log created by the software #define LOGLEVEL_INFO 3 DiscussionMessages, which provide general information about what is going on See Also LOGLEVEL_OFFLoglevels determine the amount of log created by the software #define LOGLEVEL_OFF 0 DiscussionLogging is completely disabled See Also LOGLEVEL_TRACELoglevels determine the amount of log created by the software #define LOGLEVEL_TRACE 5 DiscussionExtremely detailed description of what is happening See Also LOGLEVEL_WARNINGLoglevels determine the amount of log created by the software #define LOGLEVEL_WARNING 2 DiscussionWarning messages are logged, which inform the user of unexpected results See Also Loglevels supported by LoggerLoglevels determine the amount of log created by the software #define LOGLEVEL_OFF 0 #define LOGLEVEL_ERROR 1 #define LOGLEVEL_WARNING 2 #define LOGLEVEL_INFO 3 #define LOGLEVEL_DEBUG 4 #define LOGLEVEL_TRACE 5 Included Defines
DiscussionAll messages will be logged with logLvl < logLevel See Also |