Skip to content

MLOG_LEVEL

Mandatory logging are those critial msgs of the runtime including three levels of severity: MLOG_LEVEL_WARN: warning of likely problem, but the results might be ok MLOG_LEVEL_ERROR: error of runtime execution, program can continue, results will be wrong, but still useful MLOG_LEVEL_FATAL: fatal errors of runtime, program cannot continue.

Synopsis

Declared in <mlog.h>

enum MLOG_LEVEL;

Members

Name

Description

MLOG_LEVEL_FAIL

Internal failure level.

MLOG_LEVEL_FATAL

Fatal errors; program cannot continue.

MLOG_LEVEL_ERROR

Error conditions; results are unreliable.

MLOG_LEVEL_WARN

Warning conditions.

MLOG_LEVEL_NONE

No optional logging output.

MLOG_LEVEL_KEY

Key optional messages (user verbose level 1).

MLOG_LEVEL_INFO

Informational messages (user verbose level 2).

MLOG_LEVEL_MARCH

Marching/debug progress (user verbose level 3).

MLOG_LEVEL_TRACE

Detailed trace output (user verbose level 4).

MLOG_LEVEL_DEBUG

Debug‐only logging.

MLOG_LEVEL_UNDEFINED

Unspecified logging level.

Description

Optional logging are those msgs that provide information of program execution. It is controlled by the mlogLevel varible that control which level of information will be spit out. The levels of details incrementally include: MLOG_LEVEL_KEY MLOG_LEVEL_INFO MLOG_LEVEL_MARCH MLOG_LEVEL_TRACE The default mlogLevel is MLOG_LEVEL_NONE, i.e. no information of these four levels will spit out.

MLOG_LEVEL_DEBUG is a mlogging level that can be controlled by users, it should be used for debugging purpose only.

There are two sets of APIs to use, C‐style (printf) and C++‐style (<<), and these APIs are are simply macros that are used as functions. API names carry the level information, and each mlogging API call should also be proivde a subject to indicate the compoenents or module of this mlogging. MLogging msgs include logging level, subject, file:line, function name, and user‐specified msgs. User msgs are either C‐style printf format or C++‐style << format depending on which style to use. C‐style APIs and C++‐style APIs have _C and _CXX suffix respectively.

The mlog.h/C also include the implementation for ASSERT_*, ROSE_ASSERT, ROSE_ABORT that are used througout the source tree.

Created with MrDocs