Nyx Node
Loading...
Searching...
No Matches
Logger

Macros

#define NYX_LOG_FATAL(fmt, ...)    do { nyx_log(NYX_LOG_LEVEL_FATAL, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(1)
 Logs a fatal message.
 
#define NYX_LOG_ERROR(fmt, ...)    do { nyx_log(NYX_LOG_LEVEL_ERROR, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
 Logs an error message.
 
#define NYX_LOG_INFO(fmt, ...)    do { nyx_log(NYX_LOG_LEVEL_INFO, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
 Logs an info message.
 
#define NYX_LOG_DEBUG(fmt, ...)    do { nyx_log(NYX_LOG_LEVEL_DEBUG, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
 Logs a debug message.
 
#define NYX_LOG_VERBOSE(fmt, ...)    do { nyx_log(NYX_LOG_LEVEL_VERBOSE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)
 Logs a verbose message.
 

Typedefs

typedef enum nyx_log_level_e nyx_log_level_t
 Nyx log levels.
 

Enumerations

enum  nyx_log_level_e {
  NYX_LOG_LEVEL_NONE = 100 ,
  NYX_LOG_LEVEL_FATAL = 101 ,
  NYX_LOG_LEVEL_ERROR = 102 ,
  NYX_LOG_LEVEL_WARN = 103 ,
  NYX_LOG_LEVEL_INFO = 104 ,
  NYX_LOG_LEVEL_DEBUG = 105 ,
  NYX_LOG_LEVEL_TRACE = 106
}
 Nyx log levels. More...
 

Functions

void nyx_set_log_level (nyx_log_level_t level)
 Sets the log level threshold.
 

Variables

void STR_t file
 
void STR_t STR_t func
 
void STR_t STR_t int line
 
void STR_t STR_t int STR_t fmt
 

Detailed Description

Logger.

Macro Definition Documentation

◆ NYX_LOG_FATAL

#define NYX_LOG_FATAL (   fmt,
  ... 
)     do { nyx_log(NYX_LOG_LEVEL_FATAL, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(1)

Logs a fatal message.

Parameters
fmtPrintf-style formatting string.
...Format arguments.
Warning
This macro never returns and stops the node.

Definition at line 207 of file nyx_node.h.

◆ NYX_LOG_ERROR

#define NYX_LOG_ERROR (   fmt,
  ... 
)     do { nyx_log(NYX_LOG_LEVEL_ERROR, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)

Logs an error message.

Parameters
fmtPrintf-style formatting string.
...Format arguments.

Definition at line 218 of file nyx_node.h.

◆ NYX_LOG_INFO

#define NYX_LOG_INFO (   fmt,
  ... 
)     do { nyx_log(NYX_LOG_LEVEL_INFO, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)

Logs an info message.

Parameters
fmtPrintf-style formatting string.
...Format arguments.

Definition at line 229 of file nyx_node.h.

◆ NYX_LOG_DEBUG

#define NYX_LOG_DEBUG (   fmt,
  ... 
)     do { nyx_log(NYX_LOG_LEVEL_DEBUG, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)

Logs a debug message.

Parameters
fmtPrintf-style formatting string.
...Format arguments.

Definition at line 240 of file nyx_node.h.

◆ NYX_LOG_VERBOSE

#define NYX_LOG_VERBOSE (   fmt,
  ... 
)     do { nyx_log(NYX_LOG_LEVEL_VERBOSE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); } while(0)

Logs a verbose message.

Parameters
fmtPrintf-style formatting string.
...Format arguments.

Definition at line 251 of file nyx_node.h.

Enumeration Type Documentation

◆ nyx_log_level_e

Nyx log levels.

Definition at line 160 of file nyx_node.h.

Function Documentation

◆ nyx_set_log_level()

void nyx_set_log_level ( nyx_log_level_t  level)

Sets the log level threshold.

Parameters
levelLog level threshold.

Definition at line 41 of file log.c.

Variable Documentation

◆ file

void STR_t file

Definition at line 191 of file nyx_node.h.

◆ func

void STR_t STR_t func

Definition at line 192 of file nyx_node.h.

◆ line

void STR_t STR_t int line

Definition at line 193 of file nyx_node.h.

◆ fmt

void STR_t STR_t int STR_t fmt

Definition at line 194 of file nyx_node.h.