sniperykun / log.h

Minimal yet colorful logging lib.

Home Page:https://github.com/thlorenz/log.h

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

log.h

Minimal yet colorful logging lib.

log_info("logging an info message");
log_warn("logging a warn message");
log_debug("logging a debug message");
log_error("logging an error");

screenshot

Both log_err and log_warn append last error (errno) to message.

Installation

clib install thlorenz/log.h

Log Level

Set the log level via #define LOGLEVEL in order to control what log messages are printed. The default is 4.

  • info: min level 4
  • debug: min level 3
  • warn: min level 2
  • error: min level 1

Setting NDEBUG will not log debug messages no matter what the log level is.

Disabling Colors

#define LOG_NOCOLORS 1
#include "log.h"
/ * log without colors */

License

MIT

About

Minimal yet colorful logging lib.

https://github.com/thlorenz/log.h

License:MIT License


Languages

Language:C 100.0%