Logger is a wrapper for the glog library, providing a simplified interface for logging within C++ applications. It is designed to be easy to integrate and use.
Before you begin, ensure you have the following installed:
- Git
- CMake (version 3.10 or higher)
- A C++ compiler that supports C++20 (e.g., GCC, Clang, MSVC)
- The project uses
glog
,gflags
, andgoogletest
as Git submodules, which will be initialized during the setup process. No separate installation of these libraries is required.
Follow these steps to clone the repository, initialize submodules, and build the project:
-
Clone the repository:
git clone https://github.com/sinterwong/logger.git cd logger
-
Initialize Git submodules: MLogger uses Git submodules for its dependencies (glog, gflags, googletest).
git submodule update --init --recursive
-
Configure the project with CMake: Create a build directory and run CMake from there:
mkdir build cd build cmake ..
Optional: Specify a generator for CMake if needed, e.g.,
cmake .. -G "Visual Studio 17 2022"
for Visual Studio. Optional: You can customize the build type (default isRelWithDebInfo
):cmake .. -DCMAKE_BUILD_TYPE=Debug
orcmake .. -DCMAKE_BUILD_TYPE=Release
. -
Build the project:
cmake --build .
Optional: For multi-configuration generators (like Visual Studio), specify the configuration:
cmake --build . --config Release
. The compiled library (liblogger.so
orlogger.dll
) will be located inbuild/<target_arch>/lib
and executables (if any) inbuild/<target_arch>/bin
.
The project includes unit tests built with GoogleTest. Tests are enabled by default (MLOGGER_BUILD_TESTS=ON
).
-
Build the project (if not already done): Follow the steps in the "Building the Project" section. Ensure tests are enabled (which they are by default).
-
Run the tests: The test executable
main
will be located inbuild/<target_arch>/bin/tests/
. Navigate to your build directory and run the tests:cd build ./<target_arch>/bin/tests/main
This project is licensed under the MIT License. See the LICENSE file for details. Copyright (c) 2025 Sinter Wong