{"library":"loguru","type":"library","category":null,"description":"Simple Python logging library. Current version: 0.7.3 (Mar 2026). One global logger — no instantiation needed, just import. Default sink is stderr (not stdout). diagnose=True is the DEFAULT — shows variable values in tracebacks — leaks sensitive data in production. Must call logger.remove() before reconfiguring. Library authors must never call logger.add() — use logger.disable() instead. enqueue=True requires logger.complete() on shutdown to flush queued messages.","language":"python","status":"active","version":"0.7.3","tags":["loguru","logging","python","observability"],"install":[{"cmd":"pip install loguru","imports":["import sys\nfrom loguru import logger\n\n# Remove default stderr handler before reconfiguring\nlogger.remove()\n\n# Add stdout handler with INFO level\nlogger.add(\n    sys.stdout,\n    level='INFO',\n    format='{time:YYYY-MM-DD HH:mm:ss} | {level} | {name}:{line} | {message}',\n    diagnose=False,   # IMPORTANT: disable in production — prevents variable leak\n    backtrace=True\n)\n\n# Add file sink with rotation\nlogger.add(\n    'logs/app.log',\n    level='DEBUG',\n    rotation='10 MB',\n    retention='7 days',\n    compression='zip',\n    diagnose=False,\n    serialize=False\n)\n\nlogger.info('App started')\nlogger.debug('Debug message')\nlogger.warning('Watch out')\n\n# Exception catching\ntry:\n    1 / 0\nexcept Exception:\n    logger.exception('Division failed')","# In a library — NEVER call logger.add()\nfrom loguru import logger\n\n# Disable by default — let app developer enable if they want\nlogger.disable(__name__)\n\ndef my_library_function():\n    logger.debug('Library internal log')  # no-op unless enabled by app"]}],"homepage":null,"github":"https://github.com/Delgan/loguru","docs":"https://loguru.readthedocs.io/en/stable/index.html","changelog":"https://github.com/Delgan/loguru/blob/master/CHANGELOG.rst","pypi":"https://pypi.org/project/loguru/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":0,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/loguru/compatibility"},"provenance":{"verified_status":"passing","verified_at":"Sat Jun 27","last_verified":"Sat Jun 27","next_check":"Mon Jul 27","install_tag":"verified"}}