Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_multithreaded_logger-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_multithreaded_logger-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file async_multithreaded_logger-1.0.0.tar.gz.

File metadata

File hashes

Hashes for async_multithreaded_logger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a4b53489d4f0b62f7754a3db65251f9e95d48d7026e30c62521ab36362c824c6
MD5 03d8c4b442f5c745ce610c87a5a1009d
BLAKE2b-256 808358f56975ae21b62b22aca40230ef4636b609d051b3dd315e96ae78f25d5c

See more details on using hashes here.

File details

Details for the file async_multithreaded_logger-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for async_multithreaded_logger-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eda8078e5ff5ffc5f51c954ae00ee0d951a7af123647d7b3c9873cd342023524
MD5 31982b904bf2a8b7fc5d3e61f976347d
BLAKE2b-256 b49a419e43b6a4554f6bdb2e8537ed6085ba882e6304d555584e2d1266a9aef6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page