Trace Engine
A Raycaster Engine in C
Loading...
Searching...
No Matches
log.h File Reference

Go to the source code of this file.

Macros

#define log_debug(...)   (log_message(_LOG_LEVEL_DEBUG, __FILE__, __LINE__, __VA_ARGS__))
 
#define log_info(...)   (log_message(_LOG_LEVEL_INFO, __FILE__, __LINE__, __VA_ARGS__))
 
#define log_warning(...)   (log_message(_LOG_LEVEL_WARNING, __FILE__, __LINE__, __VA_ARGS__))
 
#define log_error(...)   (log_message(_LOG_LEVEL_ERROR, __FILE__, __LINE__, __VA_ARGS__))
 

Enumerations

enum  log_levels_t { _LOG_LEVEL_DEBUG , _LOG_LEVEL_INFO , _LOG_LEVEL_WARNING , _LOG_LEVEL_ERROR }
 

Functions

void log_message (const log_levels_t log_level, const char *file_name, const int line, const char *message,...)
 

Enumeration Type Documentation

◆ log_levels_t

Enumerator
_LOG_LEVEL_DEBUG 
_LOG_LEVEL_INFO 
_LOG_LEVEL_WARNING 
_LOG_LEVEL_ERROR 

Function Documentation

◆ log_message()

void log_message ( const log_levels_t  log_level,
const char *  file_name,
const int  line,
const char *  message,
  ... 
)

Prints to the standard output the given message formated with the given parameters.

Parameters
log_levelThe message importance level, this is used to include a keyword (DEBUG, INFO, WARNING and ERROR)
file_nameThe file name of the caller
lineThe line of the call
messageThe text to print