mrkeyoor.com_
Wed 02 Sept 07:08 UTC
Dev Toolsevaluationupdated 02 Sept 2026

loguru review

Loguru is a Python logging library built around one preconfigured logger and one method for adding output destinations. It makes colored console output, rotating files, structured records, exception capture, and contextual fields easier to set up than Python's standard logging package.

Verdict

Our Loguru sandbox installed 103 packages and passed its test command with 1,669 reported passes, but the package build exited after 8 seconds without a supplied error excerpt. Use it for Python applications where a single global logger and concise sink setup are worth the migration work. Keep standard logging at library and framework boundaries, and disable diagnostic variable capture before production traffic reaches an exception path.

We ran it

Lab card: what happened when we ran loguruScreenshot of loguru (loguru.readthedocs.io)
Install✓ · 62s103 packages · 200 MB
Build✗ · 8s
Tests✓ · 150s1669 passed · 0 failed · 46 skipped of 1669 (pytest)
Known vulns0(pip-audit)
Repo313 files~20,511 lines of source · 1.5 MB · 5 CI workflows · tests dir

Answers from our run

Does loguru build from source?

Dependencies installed in 62 seconds (103 packages), and the build failed. We cloned commit 48acf77 into a clean Debian container with 3 CPUs and no project-specific setup.

Do loguru's tests pass?

Yes: 1669 of 1669 passed when we ran the project's own test command (pytest). Some failures need services or credentials a bare container does not have.

Does loguru have known vulnerabilities in its dependencies?

pip-audit found none in the dependency tree at the time of our run.

Who should not use loguru?

Production systems that cannot risk local variable values entering exception logs: diagnose=True is the default, and the security guide says credentials may appear unless it is disabled.

What are the alternatives to loguru?

structlog, Python logging, Picologging. Our Loguru sandbox installed 103 packages and passed its test command with 1,669 reported passes, but the package build exited after 8 seconds without a supplied error excerpt.

Setup3/562-second install and passing tests, but the package build failed
Docs5/5API, migration, security, process, and sink behavior are documented
Community4/524,090 stars and active fixes, with 253 issues and pull requests
Maturity4/5Stable 0.7.3 API, broad tests, and a delayed release cadence

Who it’s for

Python application developers who want useful console logging after one import.
Services that need file rotation, retention, compression, JSON output, or contextual fields without assembling several standard logging classes.
Teams prepared to configure queueing and shutdown behavior for worker processes.
Projects that want to receive standard-library logs through an explicit interception handler.

Who it’s NOT for

Production systems that cannot risk local variable values entering exception logs: diagnose=True is the default, and the security guide says credentials may appear unless it is disabled.
Multiprocess applications seeking configuration-free file safety: the README says sinks are not multiprocess-safe unless messages are enqueued, and the recipes add platform-specific shutdown rules.
Library authors who want to install their own global handlers: Loguru's README tells libraries never to call add() and to disable their namespace until the host application opts in.
Windows programs with several processes retaining files in one directory: open issue 1495 reproduces an unhandled PermissionError on Loguru 0.7.3 when one process still holds a target file open.

Setup reality

Our sandbox install succeeded in 62 seconds, adding 103 packages and using 200 MB. The build failed with exit code 1 after 8 seconds; the supplied lab record has no log tail, so it does not establish the failed build stage. Tests succeeded in 150 seconds, with pytest reporting 1,669 passed, 0 failed, and 46 skipped of 1,669.

Local logging needs no account, service, or credential. Importing logger immediately writes to standard error. Applications must remove that default sink if they want a clean configuration, then set destinations, levels, formats, retention, and any external service credentials themselves.

The README supports Python 3.5 and newer; our image used Python 3.12. Multiprocess output needs enqueue=True, compatible process contexts, and complete() at shutdown. Production exception sinks should set diagnose=False so frame variables do not leak secrets.

One imported logger replaces named logger setup

Loguru starts producing useful output with from loguru import logger. The imported object already has a standard-error sink, color when the terminal supports it, and familiar severity methods. Calling add() attaches a path, stream, function, coroutine, or standard logging handler. That is a genuine reduction in setup for scripts and applications that otherwise repeat logger, handler, formatter, and filter wiring.

The project itself is compact. commit 48acf77 had 313 files, about 20,511 lines of source, and a 1.5 MB checkout. Its API still covers rotation, retention, compression, contextual fields, JSON serialization, custom levels, lazy argument evaluation, and exception formatting. The small repository does not make logging design automatic. A service must still decide which records belong in each sink and how long they should remain.

File rotation is easy until several processes share it

A string path is enough to create a file sink, and rotation can use a size, clock time, or age. Retention and compression use the same add() call. This is Loguru at its best: common application policy is readable where the sink is declared. Context can be attached through bind() or a scoped contextualize() block, while serialize=True turns each record into JSON for downstream processing.

Threads are safe by default, while processes need more care. The README says ordinary sinks are not multiprocess-safe and recommends enqueue=True. The detailed recipes require complete() before a worker exits and explain extra work for Windows spawn behavior and mixed multiprocessing contexts. Our development install brought in 103 packages and occupied 200 MB, so contributors also get a much larger environment than users installing only the runtime package.

What happened when we ran it

Our Python 3.12 sandbox installed the checkout in 62 seconds, adding 103 packages and consuming 200 MB. The package build then failed with exit code 1 after 8 seconds. The lab record supplied for this review does not contain the last build-log lines, so we cannot responsibly name a missing tool, bad configuration, or code defect as the cause.

Tests succeeded in 150 seconds. The supplied pytest summary reports 1,669 passed, 0 failed, and 46 skipped of 1,669. We are preserving those figures as recorded rather than recalculating the total. Pip-audit found 0 known vulnerabilities in the installed environment. Those results cover commit 48acf77 in an unprivileged container with 3 CPUs and 8 GB of RAM.

The repository scan found 5 CI workflow files, no Dockerfile, and a tests directory. A Python library seldom needs its own Dockerfile. The failed build matters to anyone publishing a wheel or source distribution from this checkout. The passing 150-second test run gives useful confidence in exercised behavior; it does not explain or cancel the separate packaging failure.

Diagnostic tracebacks can put credentials in logs

Loguru can annotate a traceback with values from stack frames. That can shorten local debugging, and it can also copy tokens, passwords, request contents, or personal data into a file or log service. The README calls this out beside its example, and the security recipes say to use diagnose=False or LOGURU_DIAGNOSE=NO in production. This should be part of the first configuration change, not a later cleanup.

Other security choices stay with the application. The recipes warn that untrusted pickle data can execute code and that attacker-controlled format strings may expose hidden object attributes. File permissions inherit Python's normal open() behavior. A successful audit with 0 known vulnerabilities says something useful about the 103 installed packages; it does not protect a service from unsafe record content, permissions, or deserialization choices.

Standard logging interop needs an explicit bridge

Loguru accepts a standard logging.Handler as a sink, which helps with syslog and existing destinations. Sending standard-library records into Loguru requires an interception handler that calculates caller depth and forwards the record. The migration guide also replaces % templates with brace formatting and named logger configuration with filters or bound context. A codebase can migrate, but imports alone do not unify both systems.

That distinction is especially important for reusable libraries. Loguru tells library authors not to add sinks because the global logger belongs to the host application. The recommended pattern disables the library's namespace until an application enables it. If downstream frameworks, test fixtures, and monitoring agents already assume standard LogRecord objects, the 62-second install is the smallest part of adoption. Test captured logs and caller attribution before changing every module.

August 2026 fixes show activity despite the old release

GitHub showed 24,090 stars and 253 combined issues and pull requests when fetched. Version 0.7.3 was released on December 6, 2024, while the repository received a push on August 30, 2026. Recent merged changes fixed async-generator exception capture and timestamp formatting. The repository is active even though users have waited much longer for another stable package.

Issue 1492 asks whether more maintainers are needed. On August 30, the author said Loguru had not been abandoned, acknowledged slow ticket handling and missed release promises, and described more work he would like to do. That is candor, not a release guarantee. Open issue 1495 also documents a Windows 11 retention failure in 0.7.3 when another process holds a log file open.

Choose Loguru for applications that own their logging policy

Loguru is easiest to recommend for an application with one place to configure sinks. The default logger gets a script out of print() quickly, while structured records and rotation leave room for a proper service configuration. Its documentation is unusually frank about secret-bearing tracebacks, process queues, library etiquette, and standard logging migration.

The lab result is mixed: 1,669 reported passes and 0 audit findings sit beside an unexplained 8-second build failure. That warrants a trial rather than blind adoption. If a framework already controls standard logging, keep its native path or bridge at one boundary. If you choose Loguru, remove the default sink, turn off diagnosis in production, and test worker shutdown on every operating system you deploy.

Alternatives

ProjectWhat it isPick it when
structlogA structured event pipeline that can render through standard logging or its own processors.pick this instead when machine-readable events and processor composition matter more than a ready-made console logger.
Python logging gh↗The standard library logging system with named loggers and broad framework support.pick this instead when zero extra dependencies and compatibility with existing handlers are the main requirements.
PicologgingA performance-focused implementation shaped as a drop-in replacement for standard logging.pick this instead when standard logging compatibility and lower logging overhead are more important than Loguru's API.

What people are saying

  1. [velocity-scout] Delgan/loguru

Sources

  1. Loguru repository and README
  2. Loguru security and multiprocessing recipes
  3. Loguru standard logging migration guide
  4. Loguru 0.7.3 release
  5. Loguru issue 1492 about maintenance capacity
  6. Loguru issue 1495 about Windows retention

More dev tools reviews

herdr · shadPS4 · poetry · croc · brew · workmux · the whole board →