Lightweight logging library for C++ programs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
src
tests
LICENSE
Makefile
README.md

README.md

Simple Logger

Logging library for C++ programs.

Author

Jung-Sang Ahn jungsang.ahn@gmail.com

How to use

Copy all files under src directory to your project, and then include logger.h.

Example code

Please refer to basic_example.cc

Features

  • Multi-thread safe.
  • Lightweight: observed up to 6M logs/second (multi-threaded) on i7 8-thread machine.
  • Different log levels and formats for file and display.
  • Circular log file reclaiming.
  • Compressing (tar.gz) old log files.
  • Stack backtrace on crash or abort (only on Linux, addr2line is needed).

Screenshot

  • On display alt text

  • On log file

2018-07-15T19:33:10.550_560-07:00 [448e] [====] Start logger: ./example_log.log (32 MB per file, up to 16 files)    [logger.cc:435, start()]
2018-07-15T19:33:10.550_659-07:00 [448e] [FATL] fatal error [basic_example.cc:29, main()]
2018-07-15T19:33:10.550_699-07:00 [448e] [ERRO] error   [basic_example.cc:30, main()]
2018-07-15T19:33:10.550_734-07:00 [448e] [WARN] warning [basic_example.cc:31, main()]
2018-07-15T19:33:10.550_774-07:00 [448e] [INFO] info    [basic_example.cc:32, main()]
2018-07-15T19:33:10.550_814-07:00 [448e] [DEBG] debug   [basic_example.cc:33, main()]
2018-07-15T19:33:10.550_854-07:00 [448e] [TRAC] trace   [basic_example.cc:34, main()]
2018-07-15T19:33:10.550_900-07:00 [448e] [====] Stop logger: ./example_log.log  [logger.cc:451, stop()]