Note
SLog is currently working on *Nix systems (Linux, macOS).
SLog is a minimal C logging library with color-coded output, multiple verbosity levels, and support for logging to stdout, stderr, files, and custom destinations.
$ git clone https://github.com/LanaMirko04/libslog.git
$ git checkout v2.x.x # replace with the latest version
$ cd slog
$ make
$ sudo make installor
Copy files in src directory to your project
.
├── ...
├── src
│ ├── main.c
│ ├── slog.c
│ └── slog.h
└── ...
Include the SLog header in your C source file:
#include <slog.h>
int main() {
struct SlogConfig config = {
.default_logger = SLOG_INIT_DEFAULT_LOGGER,
.enter_cs = NULL,
.exit_cs = NULL,
};
slog_init(&config);
/*! Print and informational message */
SLOG_INFO("Hello, SLog!");
return 0;
}More examples can be found here.
For detailed information about the API, see API.md.
SLog is licensed under the MIT License.
