Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Latest commit

 

History

History
62 lines (39 loc) · 1.51 KB

File metadata and controls

62 lines (39 loc) · 1.51 KB

Logger (Unix-Only)

A lightweight, header-only C++ logging library.
Easily integrate structured, leveled logging into your C++ projects with minimal setup.

Features

  • Header-only: Just include the header file and start logging.
  • Log Levels: Support for multiple log levels (e.g., INFO, WARNING, ERROR, DEBUG).
  • Configurable Output: Customize output format and destination (console, file, etc.).
  • Simple API: Intuitive and minimalistic usage.
  • No dependencies: Pure standard C++.

Installation

Minimal version needed: C++20 (for std::format support), but for 100% compatibility, C++23 is recommended.

Copy the header file (logger.hpp) from the include/ directory into your project. Or add this repository as a submodule and include the header:

#include "include/logger.hpp"

Usage

Simple example:

#include "include/logger.hpp"

int main() {
    int code = 42;
    Log::infoln("This is an info message!");
    Log::errorf("This is an error message! {}", code);
    // Add more examples as needed
}

Output:

example

For advanced configuration, see the code comments and examples directory.

Examples

See the examples/ directory for more usage patterns.

License

Distributed under the MIT License. See LICENSE for more information.

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a pull request.

Author

KopyTKG