Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
log.h File Reference

Logging utility functions.

#include <banjo/api.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BJ_MAXIMUM_LOG_LEN   120
 Maximum length of log messages.
 
#define bj_log(LEVEL, ...)
 Log a message using the given level LEVEL.
 
#define bj_trace(...)
 Log a message using the BJ_LOG_TRACE level.
 
#define bj_debug(...)
 Log a message using the BJ_LOG_DEBUG level.
 
#define bj_info(...)
 Log a message using the BJ_LOG_INFO level.
 
#define bj_warn(...)
 Log a message using the BJ_LOG_WARN level.
 
#define bj_err(...)
 Log a message using the BJ_LOG_ERROR level.
 
#define bj_fatal(...)
 Log a message using the BJ_LOG_FATAL level.
 

Enumerations

enum  {
  BJ_LOG_TRACE , BJ_LOG_DEBUG , BJ_LOG_INFO , BJ_LOG_WARN ,
  BJ_LOG_ERROR , BJ_LOG_FATAL
}
 Log Levels. More...
 

Functions

const char * bj_log_get_level_string (int level)
 Returns a string describing the given level.
 
void bj_log_set_level (int level)
 Sets the default log level.
 
int bj_log_get_level (void)
 Gets the current log level set by bj_log_set_level.
 
size_t bj_message (int level, const char *p_file, int line, const char *p_format,...)
 Generic message reporting function.