https://github.com/not-nik/yal
Yet another minimal C++ logger.
https://github.com/not-nik/yal
cpp logger minimal single-header single-header-lib
Last synced: 5 months ago
JSON representation
Yet another minimal C++ logger.
- Host: GitHub
- URL: https://github.com/not-nik/yal
- Owner: Not-Nik
- License: mit
- Created: 2020-02-27T12:34:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T19:31:19.000Z (over 1 year ago)
- Last Synced: 2025-10-13T00:56:35.072Z (9 months ago)
- Topics: cpp, logger, minimal, single-header, single-header-lib
- Language: C++
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yal
Yet another minimal C++ logger.
## Minimal usage
```c++
#include
using namespace log;
int main()
{
Logger * logger = Logger::GetLogger("myLogger");
logger->Info("Your Log here");
}
```
## Build integration
This expects you to have this project in a subdirectory in your project
### Using Cmake
```cmake
cmake_minimum_required(VERSION 3.15)
project(MyProject)
set(CMAKE_CXX_STANDARD 17) # needed for inline variable
add_subdirectory(yal)
add_executable(MyExecutable src/main.cpp)
target_link_libraries(MyExecutable yal)
```
### Using Makefile
```
SRCS = src/main.cpp
OBJS = $(addsuffix .o,$(basename $(SRCS)))
MyExecutable: $(OBJS)
g++ -o $@ $^
%.o: %.c
g++ -std=c++17 -Iyal/ -c -o $@ $^
clean:
rm $(OBJS)
.PHONY: clean
```