NexusLog
High-performance async logging library, compatible with Python standard logging API.
Benchmark
Benchmarking with 1,000,000 log messages
------------------------------------------------------------
Logger Time (s) Msgs/sec Log size
------------------------------------------------------------
loguru 7.675 130,297 89,888,890 bytes
Python logging 5.313 188,206 82,888,890 bytes
picologging 2.038 490,626 79,888,888 bytes
spdlog 0.199 5,034,527 79,888,890 bytes
NexusLogger 0.049 20,304,036 97,888,890 bytes
NexusLogger unix_ts 0.049 20,451,884 83,868,922 bytes
------------------------------------------------------------
NexusLogger is 4.03x faster than spdlog
NexusLogger is 41.38x faster than picologging
NexusLogger is 107.88x faster than Python logging
NexusLogger is 155.83x faster than loguru
NexusLogger unix_ts is 4.06x faster than spdlog
NexusLogger unix_ts is 41.69x faster than picologging
NexusLogger unix_ts is 108.67x faster than Python logging
NexusLogger unix_ts is 156.96x faster than loguru
Installation
pip install nexuslog
Quick Start
import nexuslog as logging
logging.basicConfig(level=logging.INFO)
logging.info("Hello, world!")
logging.warning("This is a warning")
logging.error("This is an error")
API
Log Levels
logging.TRACE
logging.DEBUG
logging.INFO
logging.WARNING
logging.ERROR
Module-level Functions
logging.basicConfig(filename=None, level=logging.INFO, unix_ts=False, color="auto", format="logfmt")
logging.basicConfig(
level=logging.INFO,
name_levels={"db": logging.DEBUG, "http.client": logging.WARNING},
)
logging.trace(message, *args)
logging.debug(message, *args)
logging.info(message, *args)
logging.warning(message, *args)
logging.error(message, *args)
Lazy %-style Formatting
Like the standard logging module, extra arguments are merged into the
message with %-style formatting — but only if the log level is enabled.
When the level is disabled, the arguments are never formatted (no
str()/repr() calls), making disabled log calls nearly free:
logger.info("price=%s qty=%s side=%s", price, qty, side)
logger.debug("state=%r retries=%d", state, retries) # zero cost at INFO level
Supported conversions: %s %r %d %i %f %e %g %x %o %%,
plus the full % operator spec (width, precision, flags, %(name)s with a
dict argument) with semantics identical to Python's message % args. Simple
placeholders are rendered natively in Rust — formatting with args is faster
than building the message with an f-string at the call site. A message
logged without args is emitted verbatim, so literal % needs no escaping.
Colored Output
logging.basicConfig(color="auto") # default
The color option controls ANSI colorization of the level value (by
severity) and the logfmt keys (dimmed):
"auto"(default) — color only when writing to a color-capable terminal. File and piped output stay plain. Honors theNO_COLOR(force off) andFORCE_COLOR(force on) environment variables;NO_COLORwins."off"— never emit ANSI color."always"— always emit ANSI color, even to files and pipes.
Colors: error red, warn yellow, info green, debug cyan, trace dim.
The message body is never colored. There is no cost on the hot path when
color is inactive.
JSON Output
logging.basicConfig(filename="app.log", format="json")
format selects the line layout:
-
"logfmt"(default) —time=... level=... [name=...] msg="...". -
"json"— one JSON object per line (NDJSON):{"time":"2026-07-09T09:45:59.914644+08:00","level":"warn","name":"svc","msg":"disk 90% full"}
Fields are
{time, level, name, msg}, with proper JSON escaping of the message.timeis an ISO-8601 string, or a number whenunix_ts=True.nameis omitted when unset. JSON output ignorescolor(it is never colorized).
NDJSON is the recommended format for shipping logs to a database: write to a file, then let a forwarder (Vector, Fluent Bit, Fluentd, Logstash) tail it and insert into ClickHouse / PostgreSQL / etc. — the JSON parses with near-zero configuration.
Logger Class
from nexuslog import Logger, Level
logger = Logger("myapp", path="/var/log/app", level=Level.Info)
logger.info("message")
logger.shutdown()
getLogger
import nexuslog as logging
logging.basicConfig(filename="/var/log/app.log", level=logging.DEBUG)
logger = logging.getLogger("myapp")
logger.info("message")
License
MIT
Metadata
Release files for nexuslog-lib 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nexuslog_lib-0.9.0.tar.gz | 173.8 kB | Details |
Built distributions (wheels)
Total release size: 6.8 MB
Release files / nexuslog_lib-0.9.0.tar.gz
| Download URL | nexuslog_lib-0.9.0.tar.gz |
|---|---|
| Size | 173.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fead48af10427db10292fb3f079e7e1f9fea21f0823f6e70dfa8c16bd2cdabf
|
|
BLAKE2b-256 checksum How to use checksums |
9301c0063128a31367f9f6978f86bfca12b8f161d89510910675a3580f678ab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp314-cp314-win_amd64.whl
| Download URL | nexuslog_lib-0.9.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 234.4 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d64700e922f743315f26327396b7b23202520f4d8e86f1723995c8fc00c3a74c
|
|
BLAKE2b-256 checksum How to use checksums |
f89d60c9a8b757e359c9bcbc5db4f160c5937b6842e8e86ce730a1c4eb579cb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 367.7 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ab859e51ef5278d97ea605bdcc6035131e392dbf06b57f05b85065cf1164703b
|
|
BLAKE2b-256 checksum How to use checksums |
4600eebeb393d5ddd44b10be0b2916962a5a374aee20b7632a6026a0bc895975
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nexuslog_lib-0.9.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 367.1 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
3ec4064930e6e85b06c61ae706ec7195d34bdabc0c29d11bcfb5e19e4b963c07
|
|
BLAKE2b-256 checksum How to use checksums |
d78a456f0a9a6df741c5ca5f50ccbeb910b5b08879413d875ea516627e192c82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | nexuslog_lib-0.9.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 333.5 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d610c22de0a1f9ef46e7e8df2b4974a2058a3b342c56cbeae0a2cace3392388f
|
|
BLAKE2b-256 checksum How to use checksums |
a0704d5df4dc1057f541ddcad7ffa33b42fbfd3cd8ad5da580a21eee442d55a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp314-cp314-macosx_10_12_x86_64.whl |
|---|---|
| Size | 343.2 kB |
| Tags | CPython 3.14 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
0fa6f6cffd7447e2bd54baf31b0cef676e0cdc76a2efaf8e77e4a3fa768a628f
|
|
BLAKE2b-256 checksum How to use checksums |
498cf8f1659e0344580dc89986111bd542f850e7e40a3cb167a2f4f7a1c537f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp313-cp313-win_amd64.whl
| Download URL | nexuslog_lib-0.9.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 234.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
69d58af1157f6743bd3ddfdd7c4752723a64bfca26ea1e3a223f144f9a330b63
|
|
BLAKE2b-256 checksum How to use checksums |
ddf848320616a6d69895eb7778b55ab2e53c7b6574ad276256c71a25dcf7cd69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 367.9 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
a5da2825391516bc3dfe62fc79b0f0956726c81e1fed98584bc2ac719a3e8e93
|
|
BLAKE2b-256 checksum How to use checksums |
12c85a67555f934a5e309a1908f929a544e0cd48333e8eb5d77bd41888376196
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nexuslog_lib-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 367.3 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
4dca9df9390a06159ebd7c434f309b93557774379c96d3f08699dfcba1d107d5
|
|
BLAKE2b-256 checksum How to use checksums |
c7e26858423950621dc804866b5cc548ce9344b9c5317d68c160f54069c3309f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | nexuslog_lib-0.9.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 333.4 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d2a1331052cc91f743d995ed2234e31a2cba9d5c497099b2e709ff84981c8b70
|
|
BLAKE2b-256 checksum How to use checksums |
89da48abe824d3285ceb538d071ca4e0645fac2482dae0b9cca9b000339ffe2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 343.3 kB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a6d16bf3dda454a59e4b0139f98d702e6671b2743c3d086bb9f905666b377b5a
|
|
BLAKE2b-256 checksum How to use checksums |
1ffd9249c7abbe3196a0b6b34b2be873c8ee14e00d675ed9eaecb8bc3edeee93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp312-cp312-win_amd64.whl
| Download URL | nexuslog_lib-0.9.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 234.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d179ed4a09640b9d0c9ce34c4852423cd5f84bf3943c7a8ab58ff1eeab3cfdb9
|
|
BLAKE2b-256 checksum How to use checksums |
6ba0c9cbcb8936bdcfc1e7fc696d68a342c50d4345e06a69b51c1a4186f92796
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 368.3 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5d78e169a62a7d275d7f9b6d9d551e329694f6c72973038324b62f4375b681f9
|
|
BLAKE2b-256 checksum How to use checksums |
506ef22296db68e60d28d06bc4e4e011bd4ea2406b58a14f6a7d71c5a85bec00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nexuslog_lib-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 367.6 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
7e9ef52c765727129614f74f127a60c24a729da4cdb06212b10d81381f874a79
|
|
BLAKE2b-256 checksum How to use checksums |
cb2e2c2aa7abc1da9e01156a5647dee863cfac34712494e3d10326a2dc078c50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | nexuslog_lib-0.9.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 333.5 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7901ce16cffe49117f312cb1222988660d830f8dc03b838472e838e38c2f70fa
|
|
BLAKE2b-256 checksum How to use checksums |
b00756935b292bd889f3df62742069a204af2693a70dcc2485db2f765f9424e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 344.3 kB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a45054cdecbc26ae682723399609bcec9e066e7fa1fbf8157b55178e526b2858
|
|
BLAKE2b-256 checksum How to use checksums |
3e7b037584154db9ef0f7e9e89cb6652a10e721332b0ea0477825f5984751a3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp311-cp311-win_amd64.whl
| Download URL | nexuslog_lib-0.9.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 236.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
10c9ad2a69fe7428327c4504a24b9757a9364486f1464af2d78d46ec9d4ab531
|
|
BLAKE2b-256 checksum How to use checksums |
953fcd95844bc605213db032d8b85b8bf7ad955ce2c2d8a5692f23514668fcce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 368.0 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4b95110f078c89589ee65b8e5cc5e3a7dcf26cbe61dec9bdf39936bbdcd3ccf1
|
|
BLAKE2b-256 checksum How to use checksums |
0ca02894e880bf0b64e1b9daf37bd04e4dd38d8c138fbc23c429ce20fac57b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nexuslog_lib-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 367.8 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
32302c4ce6149b0d22cdb0102d2aeb58eb51db6844a7db346478f62f4a0c356f
|
|
BLAKE2b-256 checksum How to use checksums |
05b51cde33be8e3b845d67c54ca5349df41bf631afeb50e540152f0e5575a380
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | nexuslog_lib-0.9.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 333.4 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
81d2952c65e2762c99fce4b6e466a3582083b7f427b7a668748708015bdfe5b7
|
|
BLAKE2b-256 checksum How to use checksums |
399b59175c9416ef5b5f017ea852d045024fef886ba6e0d1b96a463d0c2805e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nexuslog_lib-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | nexuslog_lib-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 343.5 kB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
27ab0d8f093f6c71993e1826b95672a78a82890a8db1c66a79bfd0406cb48486
|
|
BLAKE2b-256 checksum How to use checksums |
735a86da22ec04eadd3555c0a8c22ae84da6eb9dbf1d2639164e240975d5283e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|