A lightweight, high-performance asynchronous logging library for Python.
Project description
Asynchronous Logger Library
A high-performance, asynchronous logging library for C++ and Python. Designed to prevent logging I/O from blocking your application's main execution flow.
Features
- Asynchronous Design: Logging operations happen in a background thread.
- Micro-Free C++ API: Modern C++ streaming syntax (
logger::info("Sender") << "Message"). - Python Integration: Clean, idiomatic Python API.
- Optional File Output: Easily enable logging to a file at runtime.
- Thread-Safe: Safe to use from multiple threads simultaneously.
C++ Usage
Basic Logging
#include "logger.h"
// Stream-like syntax
logger::info("MyClass") << "Successfully initialized model " << modelPath;
logger::err("MyClass") << "Failed to process frame " << frameId;
Enabling File Output
logger::Logger::getInstance().setFile("app.log");
Python Usage
Installation
Python
You can install the logger for the current user or system-wide.
Option 1: System-wide (Recommended for shared use)
sudo pip install ./python
Note: If you are on a modern Linux distribution (e.g., Ubuntu 23.04+) and see an "externally-managed-environment" error, use:
sudo pip install ./python --break-system-packages
Option 2: User-only
pip install --user ./python
Option 3: Editable mode (For development)
pip install -e ./python
C++
The library uses CMake for building and installation.
Build and Install
mkdir build && cd build
cmake ../cpp
make
sudo make install
Linking in other projects
Once installed, you can find and link the library in your CMakeLists.txt:
find_package(Logger REQUIRED)
target_link_libraries(your_app PRIVATE Logger::logger)
Basic Usage
C++
#include "logger.h"
// Stream-like syntax
logger::info("MyClass") << "Successfully initialized model " << modelPath;
Python
import logger
# Convenience functions
logger.info("MyScript", "Starting processing...")
Documentation
Full documentation is available at docs/index.md or can be generated using MkDocs:
mkdocs serve
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async_multithreaded_logger-1.0.0.tar.gz.
File metadata
- Download URL: async_multithreaded_logger-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b53489d4f0b62f7754a3db65251f9e95d48d7026e30c62521ab36362c824c6
|
|
| MD5 |
03d8c4b442f5c745ce610c87a5a1009d
|
|
| BLAKE2b-256 |
808358f56975ae21b62b22aca40230ef4636b609d051b3dd315e96ae78f25d5c
|
File details
Details for the file async_multithreaded_logger-1.0.0-py3-none-any.whl.
File metadata
- Download URL: async_multithreaded_logger-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eda8078e5ff5ffc5f51c954ae00ee0d951a7af123647d7b3c9873cd342023524
|
|
| MD5 |
31982b904bf2a8b7fc5d3e61f976347d
|
|
| BLAKE2b-256 |
b49a419e43b6a4554f6bdb2e8537ed6085ba882e6304d555584e2d1266a9aef6
|