https://github.com/xorz57/logger
Logger written in C++11
https://github.com/xorz57/logger
cpp cpp-library cpp11 cpp11-library header-only header-only-library logger logging logging-library
Last synced: 2 months ago
JSON representation
Logger written in C++11
- Host: GitHub
- URL: https://github.com/xorz57/logger
- Owner: xorz57
- License: mit
- Created: 2023-03-27T18:28:47.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T09:06:31.000Z (about 1 year ago)
- Last Synced: 2024-03-18T01:35:39.418Z (about 1 year ago)
- Topics: cpp, cpp-library, cpp11, cpp11-library, header-only, header-only-library, logger, logging, logging-library
- Language: C++
- Homepage: https://xorz57.github.io/Logger
- Size: 206 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Logger
[](https://github.com/xorz57/Logger/actions/workflows/Build.yml)
[](https://sonarcloud.io/summary/new_code?id=xorz57_Logger)## Example
```c++
#include "Logger/Logger.hpp"int main() {
Logger::SetLevel(Logger::Level::Trace);
Logger::EnableFileOutput();
Logger::SetFileOutput("Example.log");
Logger::Trace("trace");
Logger::Debug("debug");
Logger::Info("info");
Logger::Warn("warn");
Logger::Error("error");
Logger::Critical("critical");
return 0;
}
```## Output
```console
[2023-03-22 11:17:11] [trace] trace
[2023-03-22 11:17:11] [debug] debug
[2023-03-22 11:17:11] [info] info
[2023-03-22 11:17:11] [warn] warn
[2023-03-22 11:17:11] [error] error
[2023-03-22 11:17:11] [critical] critical
```## How to Build
#### Linux & macOS
```bash
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.shgit clone https://github.com/xorz57/Logger.git
cd Logger
cmake -B build -DCMAKE_BUILD_TYPE=Release -S . -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Release
ctest --build-config Release
```#### Windows
```powershell
git clone https://github.com/microsoft/vcpkg.git C:/vcpkg
C:/vcpkg/bootstrap-vcpkg.bat
C:/vcpkg/vcpkg.exe integrate installgit clone https://github.com/xorz57/Logger.git
cd Logger
cmake -B build -DCMAKE_BUILD_TYPE=Release -S . -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Release
ctest --build-config Release
```