Logger v1.0.0
Custom cli console for creating commands executable at runtime
Loading...
Searching...
No Matches
Logger

A simple logging library utilising multithreading to avoid stopping the main thread's work.

Build Documentation License Top Language

Features

  • Setting the log levels.
  • Logging messages to the console.
  • Creating seperate threads to let the main thread run without stopping.

Requirements

  • C++23 compiler
  • CMake 3.14+
  • Git

Instalation

Clone from github:

git clone https://github.com/Boxur/logger external/logger

CMake

Add to your project in CMake:

add_subdirectory(external/logger)
target_link_libraries(project PRIVATE logger)

Examples

Each of the examples assumes the following header is included

#include <lg/logger.hpp>

Setting the log level to only display error messages

lg::log.SetLevel((short)lg::Log::LogLevel::error);
void SetLevel(short log_level)
Sets the levels that are supposed to be displayed.
Definition logger.cpp:18

Printing a log of default level info

lg::log("Message");

Printing a log of level error

lg::log(lg::Log::LogLevel::error, "Error log");

An example of all three code fragments can be found at Example

Contributing

Contributions, bug reports, and suggestions are welcome.

Before submitting a pull request, please ensure that the project builds successfully

License

This project is licensed under the MIT License. See LICENSE for details.