clibs
Tiny but handy utility libraries for C
Macros
clibs_logging.h File Reference

Logging-related macros. More...

#include <stdio.h>
#include <stdlib.h>
Include dependency graph for clibs_logging.h:

Go to the source code of this file.

Macros

#define CLIBS_LOG_LEVEL_DEBUG   5
 
#define CLIBS_LOG_LEVEL_INFO   4
 
#define CLIBS_LOG_LEVEL_WARN   3
 
#define CLIBS_LOG_LEVEL_ERROR   2
 
#define CLIBS_LOG_LEVEL_FATAL   1
 
#define CLIBS_LOG_LEVEL_NONE   0
 
#define CLIBS_LOG_LEVEL   CLIBS_LOG_LEVEL_NONE
 The logging level of an application. More...
 
#define END_OF_LINE   "\n"
 
#define CLIBS_LOG_DEBUG(format, ...)
 DEBUG-level log More...
 
#define CLIBS_LOG_INFO(format, ...)
 INFO-level log More...
 
#define CLIBS_LOG_WARN(format, ...)
 WARN-level log More...
 
#define CLIBS_LOG_ERROR(format, ...)
 ERROR-level log More...
 
#define CLIBS_LOG_FATAL(format, ...)
 FATAL-level log More...
 

Detailed Description

Logging-related macros.

Author
ByteBard

Macro Definition Documentation

◆ CLIBS_LOG_DEBUG

#define CLIBS_LOG_DEBUG (   format,
  ... 
)

DEBUG-level log

Parameters
formatThe formated string.

The logs are available only when CLIBS_LOG_LEVEL is at DEBUG.

◆ CLIBS_LOG_ERROR

#define CLIBS_LOG_ERROR (   format,
  ... 
)

ERROR-level log

Parameters
formatThe formated string.

The logs are available only when CLIBS_LOG_LEVEL is at ERROR or above.

◆ CLIBS_LOG_FATAL

#define CLIBS_LOG_FATAL (   format,
  ... 
)

FATAL-level log

Parameters
formatThe formated string.

The logs are available only when CLIBS_LOG_LEVEL is at FATAL or above.

◆ CLIBS_LOG_INFO

#define CLIBS_LOG_INFO (   format,
  ... 
)

INFO-level log

Parameters
formatThe formated string.

The logs are available only when CLIBS_LOG_LEVEL is at INFO or above.

◆ CLIBS_LOG_LEVEL

#define CLIBS_LOG_LEVEL   CLIBS_LOG_LEVEL_NONE

The logging level of an application.

Available logging levels: DEBUG, INFO, WARN, ERROR and FATAL. Logging levels are defined by macro variables of the same names.

◆ CLIBS_LOG_WARN

#define CLIBS_LOG_WARN (   format,
  ... 
)

WARN-level log

Parameters
formatThe formated string.

The logs are available only when CLIBS_LOG_LEVEL is at WARN or above.