HumbleLogging is a lightweight C++ logging framework.
It aims to be extendible, easy to understand and as fast as possible.
Do NOT use master
branch for productivity!
- Portable logging library (C++17).
- Dependency free, no third-party libraries required.
- Synchronized logging accross multiple threads.
- Configuration from external file.
- Changable log-levels, appenders (outputs) and formats during runtime.
- No restriction on logger names.
- Multiple appenders for loggers (outputs).
- Simple API to implement custom appenders and formatters.
-
NullAppender
Doesn't log anything. It is mostly used for performance testing. -
ConsoleAppender
Prints log-events tostdout
. -
FileAppender
Writes all log-events to a single file. -
RollingFileAppender
Writes all log-events to a file which gets rolled as it reaches a configured size (e.g.: file.log, file.log.1, file.log.2, ...). The file's size and the number of files can be configured.
-
SimpleFormatter
The default Formatter includes the most important information in a predefined layout. -
PatternFormatter
Provides placeholders to define a custom log messages format
(e.g.:[%date] [%lls] [line=%line] [file=%filename] %m\n
)
HumbleLogging only needs a C++17 compiler and an available implementation of the standard template library (STL).
It has been tested on Linux and Microsoft Windows.
Download or clone the latest release package (.tar or .zip).
Note: Building from source requires CMake (>=2.8) installed on your machine.
git clone [email protected]:mfreiholz/humblelogging.git
git checkout <version-tag>
tar -xfz humblelogging-XXX.tar.gz
cd humblelogging
cd humblelogging/
mkdir build
cd build
cmake ..
After you ran these commands you have a Makefile or Visual Studio solution (.sln) to build the library.
Linux: Type make
as next command in your console to build.
Windows: Double click the HumbleLogging.sln
and build with
Visual Studio.
HumbleLogging can be build in different variants which makes it
possible to run in many different environments with best settings.
All build-options must be provided as CMake command line arguments with
the -D
parameter. You can append as many options as you want.
-DBuildShared=ON default=OFF
Builds the library as static or shared library.
-DBuildTests=ON default=OFF
Builds all sub projects in the
./tests/
folder, based on GTest. You do not need these projects to include the library in your project, but they might be used for testing purposes.
-DBuildApps=OFF default=ON
Builds all sub projects in the
./apps/
folder. You do not need these projects to include the library in your project, but they might be used for testing purposes.
See ./apps/basic_example
for a working example.
Feel free to write a review, comparison, benchmark or submit bugs and features on GitHub.
Manuel Freiholz, Germany, GitHub Profile Daniel Toplak, Germany, GitHub Profile