A lightweight logging utility for C++ applications.
- Four log levels: Info, Debug, Warning, Error
- Automatic stream routing (stdout for info/debug, stderr for warnings/errors)
- Caller, function, and msg context in every log message
- Debug logs compiled out in release builds (NDEBUG)
- Custom warning return value for permissible warnings
- C++17 or later
- One of the following Build Systems,
- CMake 3.20+
- Meson 1.1+
include(FetchContent)
FetchContent_Declare(starlet_logger
GIT_REPOSITORY https://github.com/starlet-engine/logger.git
GIT_TAG main
)
FetchContent_MakeAvailable(starlet_logger)
target_link_libraries(app_name PRIVATE starlet_logger)Note: Meson does not fetch dependencies automatically. Add the
starlet_logger.wrapfile to your project'ssubprojectsdirectory.
In your meson.build:
starlet_logger = subproject('starlet_logger')
starlet_logger_dep = starlet_logger.get_variable('starlet_logger_dep')
executable('app_name', 'main.cpp', dependencies: starlet_logger_dep)# 1. Clone starlet-logger
git clone https://github.com/starlet-engine/logger.git
cd starlet-loggercmake -B build -DBUILD_TESTS=ON
cmake --build build
ctest --test-dir buildmeson setup build -Dbuild_tests=true
meson compile -C build
meson test -C buildMIT License - see LICENSE for details.