Jetson Linux API Reference

32.7.5 Release

Detailed Description

This file defines macros that provide message logging functionality.

Macros

#define LOG_LEVEL_INFO   0
 Specifies the log level for Information messages. More...
 
#define LOG_LEVEL_ERROR   1
 Specifies the log level for Error messages. More...
 
#define LOG_LEVEL_WARN   2
 Specifies the log level for Warning messages. More...
 
#define LOG_LEVEL_DEBUG   3
 Specifies the log level for Debug messages. More...
 
#define DEFAULT_LOG_LEVEL   LOG_LEVEL_ERROR
 Specifies the default log level. More...
 
#define PRINT_MSG(level, str1)
 Prints log messages. More...
 
#define INFO_MSG(str)   PRINT_MSG(LOG_LEVEL_INFO, str)
 Prints a log message of level LOG_LEVEL_INFO. More...
 
#define COMP_INFO_MSG(str)   INFO_MSG("<" << comp_name << "> " << str)
 Prints a component-specific log message of level LOG_LEVEL_INFO. More...
 
#define CAT_INFO_MSG(str)   INFO_MSG("<" CAT_NAME "> " << str)
 Prints a category-specific (Component type) system error log message of level LOG_LEVEL_INFO. More...
 
#define ERROR_MSG(str)   PRINT_MSG(LOG_LEVEL_ERROR, str)
 Prints a log message of level LOG_LEVEL_ERROR. More...
 
#define COMP_ERROR_MSG(str)   ERROR_MSG("<" << comp_name << "> " << str)
 Prints a component-specific log message of level LOG_LEVEL_ERROR. More...
 
#define CAT_ERROR_MSG(str)   ERROR_MSG("<" CAT_NAME "> " << str)
 Prints a category-specific (Component type) log message of level LOG_LEVEL_ERROR. More...
 
#define SYS_ERROR_MSG(str)   ERROR_MSG(str << ": " << strerror(errno))
 Prints a system error log message of level LOG_LEVEL_ERROR with the string description of the errno value appended. More...
 
#define COMP_SYS_ERROR_MSG(str)   SYS_ERROR_MSG("<" << comp_name << "> " << str)
 Prints a component-specific system error log message of level LOG_LEVEL_ERROR. More...
 
#define CAT_SYS_ERROR_MSG(str)   SYS_ERROR_MSG("<" CAT_NAME "> " << str)
 Prints a category-specific (Component type) system error log message of level LOG_LEVEL_ERROR. More...
 
#define WARN_MSG(str)   PRINT_MSG(LOG_LEVEL_WARN, str)
 Prints a log message of level LOG_LEVEL_WARN. More...
 
#define COMP_WARN_MSG(str)   WARN_MSG("<" << comp_name << "> :" << str)
 Prints a component-specific log message of level LOG_LEVEL_WARN. More...
 
#define CAT_WARN_MSG(str)   WARN_MSG("<" CAT_NAME "> " << str)
 Print a category-specific (Component type) log message of level LOG_LEVEL_WARN. More...
 
#define DEBUG_MSG(str)   PRINT_MSG(LOG_LEVEL_DEBUG, str)
 Prints a log message of level LOG_LEVEL_DEBUG. More...
 
#define COMP_DEBUG_MSG(str)   DEBUG_MSG("<" << comp_name << "> :" << str)
 Prints a component-specific log message of level LOG_LEVEL_DEBUG. More...
 
#define CAT_DEBUG_MSG(str)   DEBUG_MSG("<" CAT_NAME "> " << str)
 Prints a category-specific (Component type) log message of level LOG_LEVEL_DEBUG. More...
 

Variables

int log_level
 Holds the current log level at runtime by assignment of one of the LOG_LEVEL_* values. More...
 

Macro Definition Documentation

◆ CAT_DEBUG_MSG

#define CAT_DEBUG_MSG (   str)    DEBUG_MSG("<" CAT_NAME "> " << str)

Prints a category-specific (Component type) log message of level LOG_LEVEL_DEBUG.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <cat_name> <message_content>

Definition at line 230 of file NvLogging.h.

◆ CAT_ERROR_MSG

#define CAT_ERROR_MSG (   str)    ERROR_MSG("<" CAT_NAME "> " << str)

Prints a category-specific (Component type) log message of level LOG_LEVEL_ERROR.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <cat_name> <message_content>

Definition at line 159 of file NvLogging.h.

◆ CAT_INFO_MSG

#define CAT_INFO_MSG (   str)    INFO_MSG("<" CAT_NAME "> " << str)

Prints a category-specific (Component type) system error log message of level LOG_LEVEL_INFO.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE: LINE_NUM) <cat_name> <message_content>

Definition at line 136 of file NvLogging.h.

◆ CAT_SYS_ERROR_MSG

#define CAT_SYS_ERROR_MSG (   str)    SYS_ERROR_MSG("<" CAT_NAME "> " << str)

Prints a category-specific (Component type) system error log message of level LOG_LEVEL_ERROR.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <cat_name> <message_content>

Definition at line 183 of file NvLogging.h.

◆ CAT_WARN_MSG

#define CAT_WARN_MSG (   str)    WARN_MSG("<" CAT_NAME "> " << str)

Print a category-specific (Component type) log message of level LOG_LEVEL_WARN.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <cat_name> <message_content>

Definition at line 207 of file NvLogging.h.

◆ COMP_DEBUG_MSG

#define COMP_DEBUG_MSG (   str)    DEBUG_MSG("<" << comp_name << "> :" << str)

Prints a component-specific log message of level LOG_LEVEL_DEBUG.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <comp_name> <message_content>

Definition at line 221 of file NvLogging.h.

◆ COMP_ERROR_MSG

#define COMP_ERROR_MSG (   str)    ERROR_MSG("<" << comp_name << "> " << str)

Prints a component-specific log message of level LOG_LEVEL_ERROR.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <comp_name> <message_content>

Definition at line 150 of file NvLogging.h.

◆ COMP_INFO_MSG

#define COMP_INFO_MSG (   str)    INFO_MSG("<" << comp_name << "> " << str)

Prints a component-specific log message of level LOG_LEVEL_INFO.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE: LINE_NUM) <comp_name> <message_content>

Definition at line 127 of file NvLogging.h.

◆ COMP_SYS_ERROR_MSG

#define COMP_SYS_ERROR_MSG (   str)    SYS_ERROR_MSG("<" << comp_name << "> " << str)

Prints a component-specific system error log message of level LOG_LEVEL_ERROR.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <comp_name> <message_content>

Definition at line 174 of file NvLogging.h.

◆ COMP_WARN_MSG

#define COMP_WARN_MSG (   str)    WARN_MSG("<" << comp_name << "> :" << str)

Prints a component-specific log message of level LOG_LEVEL_WARN.

This is used by the components internally and should not be used by the application.

Messages are in the following form: [LEVEL] (FILE:LINE_NUM) <comp_name> <message_content>

Definition at line 197 of file NvLogging.h.

◆ DEBUG_MSG

#define DEBUG_MSG (   str)    PRINT_MSG(LOG_LEVEL_DEBUG, str)

Prints a log message of level LOG_LEVEL_DEBUG.

Definition at line 212 of file NvLogging.h.

◆ DEFAULT_LOG_LEVEL

#define DEFAULT_LOG_LEVEL   LOG_LEVEL_ERROR

Specifies the default log level.

Definition at line 80 of file NvLogging.h.

◆ ERROR_MSG

#define ERROR_MSG (   str)    PRINT_MSG(LOG_LEVEL_ERROR, str)

Prints a log message of level LOG_LEVEL_ERROR.

Definition at line 141 of file NvLogging.h.

◆ INFO_MSG

#define INFO_MSG (   str)    PRINT_MSG(LOG_LEVEL_INFO, str)

Prints a log message of level LOG_LEVEL_INFO.

Definition at line 118 of file NvLogging.h.

◆ LOG_LEVEL_DEBUG

#define LOG_LEVEL_DEBUG   3

Specifies the log level for Debug messages.

Definition at line 69 of file NvLogging.h.

◆ LOG_LEVEL_ERROR

#define LOG_LEVEL_ERROR   1

Specifies the log level for Error messages.

Definition at line 61 of file NvLogging.h.

◆ LOG_LEVEL_INFO

#define LOG_LEVEL_INFO   0

Specifies the log level for Information messages.

Definition at line 57 of file NvLogging.h.

◆ LOG_LEVEL_WARN

#define LOG_LEVEL_WARN   2

Specifies the log level for Warning messages.

Definition at line 65 of file NvLogging.h.

◆ PRINT_MSG

#define PRINT_MSG (   level,
  str1 
)
Value:
if(level <= log_level) { \
std::ostringstream ostr; \
ostr << "[" << log_level_name[level] << "] (" << \
__FILE__ << ":" __LINE_NUM_STR__ ") " << \
str1 << std::endl; \
std::cerr << ostr.str(); \
}

Prints log messages.

Prints a log message only if the current log_level is greater than or equal to the level of the message.

Messages are in the following form: [LEVEL] (FILE: LINE_NUM) Message

Parameters
[in]levelThe Log level of the message.
[in]str1The NULL-terminated char array to print.

Definition at line 107 of file NvLogging.h.

◆ SYS_ERROR_MSG

#define SYS_ERROR_MSG (   str)    ERROR_MSG(str << ": " << strerror(errno))

Prints a system error log message of level LOG_LEVEL_ERROR with the string description of the errno value appended.

Definition at line 165 of file NvLogging.h.

◆ WARN_MSG

#define WARN_MSG (   str)    PRINT_MSG(LOG_LEVEL_WARN, str)

Prints a log message of level LOG_LEVEL_WARN.

Definition at line 188 of file NvLogging.h.

Variable Documentation

◆ log_level

int log_level

Holds the current log level at runtime by assignment of one of the LOG_LEVEL_* values.

log_level
int log_level
Holds the current log level at runtime by assignment of one of the LOG_LEVEL_* values.