Fast C++ logging library
Copy the include folder to your build tree and use a C++11 compiler.
$ git clone https://github.com/gabime/spdlog.git
$ cd spdlog && mkdir build && cd build
$ cmake .. && cmake --build .see example CMakeLists.txt on how to use.
- Linux, FreeBSD, OpenBSD, Solaris, AIX
- Windows (msvc 2013+, cygwin)
- macOS (clang 3.5+)
- Android
- Debian:
sudo apt install libspdlog-dev - Homebrew:
brew install spdlog - MacPorts:
sudo port install spdlog - FreeBSD:
pkg install spdlog - Fedora:
dnf install spdlog - Gentoo:
emerge dev-libs/spdlog - Arch Linux:
pacman -S spdlog - openSUSE:
sudo zypper in spdlog-devel - ALT Linux:
apt-get install libspdlog-devel - vcpkg:
vcpkg install spdlog - conan:
conan install --requires=spdlog/[*] - conda:
conda install -c conda-forge spdlog - build2:
depends: spdlog ^1.8.2
- Very fast (see benchmarks below).
- Headers only or compiled
- Feature-rich formatting, using the excellent fmt library.
- Asynchronous mode (optional)
- Custom formatting.
- Multi/Single threaded loggers.
- Various log targets:
- Rotating log files.
- Daily log files.
- Console logging (colors supported).
- syslog.
- Windows event log.
- Windows debugger (
OutputDebugString(..)). - Log to Qt widgets (example).
- Easily extendable with custom log targets.
- Log filtering - log levels can be modified at runtime as well as compile time.
- Support for loading log levels from argv or environment var.
- Backtrace support - store debug messages in a ring buffer and display them later on demand.
#include "spdlog/spdlog.h"
int main()
{
spdlog::info("Welcome to spdlog!");
spdlog::error("Some error message with arg: {}", 1);
spdlog::warn("Easy padding in numbers like {:08d}", 12);
spdlog::critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42);
spdlog::info("Support for floats {:03.2f}", 1.23456);
spdlog::info