Skip to content

WsprryPi/LCBLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCBLog - A Thread-Safe C++ Logging Library

License: MIT C++

Table of Contents


📌 Overview

LCBLog is a flexible and thread-safe C++ logging library designed primarily for long-running daemon-style applications. It provides:

  • Multiple log levels (DEBUG, INFO, WARN, ERROR, FATAL)
  • Thread safety using std::mutex
  • Non-blocking logging using internal worker threads and queues
  • Optional timestamps
  • Multi-line message handling
  • Pluggable backends:
    • Standard output/error streams
    • Native systemd journald integration

🚀 Features

  • [✔] Log level filtering
  • [✔] Thread-safe, async logging
  • [✔] stdout/stderr or journald backends
  • [✔] Explicit journald priority mapping
  • [✔] One-time startup backend banner

📂 Project Structure

📁 LCBLog
├─ README.md
├─ LICENSE
└─ src
   ├─ lcblog.hpp
   ├─ lcblog.cpp
   ├─ lcblog.tpp
   ├─ main.cpp
   └─ Makefile

🛠️ Installation & Compilation

🔧 Prerequisites

  • C++20
  • make
  • Optional: libsystemd-dev

💻 Building

make

📓 systemd / journald Integration

Install systemd headers:

sudo apt install libsystemd-dev

Enable journald:

logger.enableJournald(true);
logger.setJournaldIdentifier("wsprrypi");

Log Level Mapping

LCBLog journald
DEBUG 7
INFO 6
WARN 4
ERROR 3
FATAL 2

📜 License

MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors