Class Description

The Log API is defined in Log.h. Currently, this API is for internal use only.

Log Level Enumerations

enum LogLevels {
    LOG_LEVEL_DEBUG = -1,
    LOG_LEVEL_INFO = 0,
    LOG_LEVEL_WARN = 1,
    LOG_LEVEL_ERROR = 2,
    LOG_LEVEL_FATAL = 3,
    LOG_LEVEL_NONE
};

The following macro definitions can be used to print logs:

Table 1 Macro definitions

Macro Definition

Description

#define LogDebug VLOG(MxBase::LOG_LEVEL_DEBUG)

LogDebug records the debugging information.

#define LogInfo LOG(INFO)

LogInfo records information in key steps (such as initialization), which is irrelevant to data.

#define LogWarn LOG(WARNING)

LogWarn records warning information generated during data processing.

#define LogError LOG(ERROR)

LogError records error information during data processing.

#define LogFatal LOG(FATAL)

LogFatal records fatal information in key steps (such as initialization).

Examples

LogDebug << "Begin to process MpDataSerialize(" << elementName_ << ").";
LogInfo << "Begin to initialize MpDataSerialize(" << elementName_ << ").";
LogWarn << "Input data is invalid, element (" << elementName_ <<") will not run normally.";
LogError << GetError(ret, elementName_) << "Fail to initialize dvppWrapper_ object.";
LogFatal << GetError(ret, elementName_) << "Invalid transfer mode.";