{
  "id": "task_libraries:logging/python",
  "path": "/exapedia/python-logging-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python logging libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python logging libraries record events from a running program, such as requests, warnings, and errors. Most of them extend the standard logging module that ships with Python. These libraries give developers the records they search when a service fails in production."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python logging libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#richhandler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F120"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F121"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F122"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#opentelemetry-sdk",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F136"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sentry-sdk",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#structlog",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F173"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F23"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-json-logger",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F189"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#loguru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F207"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F47"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#colorlog",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F224"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#coloredlogs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F242"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#richhandler",
          "label": [
            {
              "t": "text",
              "text": "Rich"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F121"
        },
        {
          "t": "text",
          "text": ", a count that covers the whole Rich package rather than its logging handler alone."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Local JSON log rendering",
            "Colored terminal logging",
            "Stdlib Formatter class"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#richhandler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F120"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F127"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F128"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#opentelemetry-sdk",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F136"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sentry-sdk",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#structlog",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F173"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-json-logger",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F189"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#loguru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F207"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#colorlog",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F224"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#coloredlogs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F242"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "richhandler",
          "name": [
            {
              "t": "fact",
              "fact": "F120"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Textualize/rich"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/rich"
            },
            {
              "label": "Docs",
              "href": "https://rich.readthedocs.io/en/stable/logging.html"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Rich renders formatted text, tables, progress bars, and syntax highlighting in the terminal, and its "
            },
            {
              "t": "code",
              "text": "RichHandler"
            },
            {
              "t": "text",
              "text": " class is a handler for the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module. The handler formats and colorizes each record that "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " emits. Passing it in the "
            },
            {
              "t": "code",
              "text": "handlers"
            },
            {
              "t": "text",
              "text": " list of "
            },
            {
              "t": "code",
              "text": "logging.basicConfig"
            },
            {
              "t": "text",
              "text": " changes the output without touching any log call. With "
            },
            {
              "t": "code",
              "text": "rich_tracebacks"
            },
            {
              "t": "text",
              "text": " set, exceptions go through Rich's traceback formatter, which shows more context than the built-in one, and "
            },
            {
              "t": "code",
              "text": "tracebacks_suppress"
            },
            {
              "t": "text",
              "text": " hides frames from frameworks such as Click."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F121"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F123"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F122"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://rich.readthedocs.io/en/stable/logging.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F120"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F11"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/fastapi-cli",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F134"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def setup_logging(terminal_width: int | None = None, level: int = logging.INFO) -> None:\n    logger = logging.getLogger(\"fastapi_cli\")\n    console = Console(width=terminal_width) if terminal_width else None\n    rich_handler = RichHandler(\n        show_time=False,\n        rich_tracebacks=True,\n        tracebacks_show_locals=True,\n        markup=True,\n        show_path=False,\n        console=console,\n    )\n    rich_handler.setFormatter(logging.Formatter(\"%(message)s\"))\n    logger.addHandler(rich_handler)\n\n    logger.setLevel(level)\n    logger.propagate = False",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/fastapi-cli/blob/a93728649bbab4f26a5216f420066695d3b2ee00/src/fastapi_cli/logging.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F133"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20rich%20for%20logging%20configuration%2C%20request%20context%2C%20structured%20events%20and%20exception%20output&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F120"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import logging\nfrom rich.logging import RichHandler\n\nFORMAT = \"%(message)s\"\nlogging.basicConfig(\n    level=\"NOTSET\", format=FORMAT, datefmt=\"[%X]\", handlers=[RichHandler()]\n)\n\nlog = logging.getLogger(\"rich\")\nlog.info(\"Hello, World!\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://rich.readthedocs.io/en/stable/logging.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "logging.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F125"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "opentelemetry-sdk",
          "name": [
            {
              "t": "fact",
              "fact": "F136"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/open-telemetry/opentelemetry-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/opentelemetry-sdk"
            },
            {
              "label": "Docs",
              "href": "https://opentelemetry-python.readthedocs.io/en/latest/sdk/_logs.html"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "The OpenTelemetry SDK is the Python implementation of OpenTelemetry for traces, metrics, and logs. For logs, "
            },
            {
              "t": "code",
              "text": "LoggingHandler"
            },
            {
              "t": "text",
              "text": " attaches to the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module and writes each record in OTLP, the OpenTelemetry protocol. Processors such as "
            },
            {
              "t": "code",
              "text": "BatchLogRecordProcessor"
            },
            {
              "t": "text",
              "text": " pass records to an exporter. "
            },
            {
              "t": "code",
              "text": "ConsoleLogRecordExporter"
            },
            {
              "t": "text",
              "text": " prints them for debugging, while sending them to a collector over HTTP or gRPC takes a separate exporter package, such as "
            },
            {
              "t": "code",
              "text": "opentelemetry-exporter-otlp-proto-http"
            },
            {
              "t": "text",
              "text": "."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://opentelemetry-python.readthedocs.io/en/latest/sdk/_logs.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F136"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F270"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F271"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/openlit/openlit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F152"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def setup_events(\n    application_name,\n    environment,\n    event_logger,\n    otlp_endpoint,\n    otlp_headers,\n    disable_batch,\n):\n    \"\"\"Setup OpenTelemetry events with the given configuration.\n\n    Args:\n        application_name: Name of the application\n        environment: Deployment environment\n        event_logger: Optional pre-configured Logger instance\n        otlp_endpoint: Optional OTLP endpoint for exporter\n        otlp_headers: Optional headers for OTLP exporter\n\n    Returns:\n        Logger: The configured OTel Logger for emitting events as LogRecords\n    \"\"\"\n    # If an external events_logger is provided, return it immediately.\n    if event_logger:\n        return event_logger\n\n    # Proceed with setting up a new events or configuration only if EVENTS_SET is False.\n    global EVENTS_SET\n\n    try:\n        if not EVENTS_SET:\n            existing_provider = _logs.get_logger_provider()\n\n            if isinstance(existing_provider, SDKLoggerProvider):\n                logger.info(\"Detected existing LoggerProvider, reusing it\")\n            else:\n                # No SDK provider configured yet -- create one.\n                resource = Resource.create(\n                    attributes={\n                        SERVICE_NAME: application_name,\n                        DEPLOYMENT_ENVIRONMENT: environment,\n                        TELEMETRY_SDK_NAME: \"openlit\",\n                    }\n                )\n\n                logger_provider = SDKLoggerProvider(resource=resource)\n\n                if otlp_endpoint is not None:\n                    os.environ[\"OTEL_EXPORTER_OTLP_ENDPOINT\"] = otlp_endpoint\n\n                if otlp_headers is not None:\n                    if isinstance(otlp_headers, dict):\n                        headers_str = \",\".join(\n                            f\"{key}={value}\" for key, value in otlp_headers.items()\n                        )\n                    else:\n                        headers_str = otlp_headers\n\n                    os.environ[\"OTEL_EXPORTER_OTLP_HEADERS\"] = headers_str\n\n                exporters_config = parse_exporters(\"OTEL_LOGS_EXPORTER\")\n                processors_added = False\n\n                if exporters_config is not None:\n                    for exporter_name in exporters_config:\n                        if exporter_name == \"otlp\":\n                            event_exporter = OTLPLogExporter()\n                            log_processor = (\n                                BatchLogRecordProcessor(event_exporter)\n                                if not disable_batch\n                                else SimpleLogRecordProcessor(event_exporter)\n                            )\n                            logger_provider.add_log_record_processor(log_processor)\n                            processors_added = True\n                        elif exporter_name == \"console\":\n                            event_exporter = ConsoleLogRecordExporter()\n                            log_processor = SimpleLogRecordProcessor(event_exporter)\n                            logger_provider.add_log_record_processor(log_processor)\n                            processors_added = True\n                        elif exporter_name == \"none\":\n                            continue\n                        else:\n                            logger.warning(\"Unknown log exporter: %s\", exporter_name)\n\n                    if not processors_added:\n                        logger.warning(\n                            \"OTEL_LOGS_EXPORTER is set but no valid exporters \"\n                            \"configured. Log export is disabled. \"\n                            \"Valid exporters: otlp, console\"\n                        )\n                else:\n                    if os.getenv(\"OTEL_EXPORTER_OTLP_ENDPOINT\"):\n                        event_exporter = OTLPLogExporter()\n                        # pylint: disable=line-too-long\n                        log_processor = (\n                            BatchLogRecordProcessor(event_exporter)\n                            if not disable_batch\n                            else SimpleLogRecordProcessor(event_exporter)\n                        )\n                    else:\n                        event_exporter = ConsoleLogRecordExporter()\n                        log_processor = SimpleLogRecordProcessor(event_exporter)\n\n                    logger_provider.add_log_record_processor(log_processor)\n\n                _logs.set_logger_provider(logger_provider)\n\n            EVENTS_SET = True\n\n        return _logs.get_logger(__name__)\n\n    except Exception as e:\n        logger.error(\"Failed to setup OpenTelemetry events: %s\", e, exc_info=True)\n        return None",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/openlit/openlit/blob/40bbb4af37ecaa69de1f2d889a7995043f1f35ae/sdk/python/src/openlit/otel/events.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F151"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=opentelemetry-sdk%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F136"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from opentelemetry.sdk._logs import LoggerProvider\nfrom opentelemetry.sdk._logs.export import ConsoleLogRecordExporter, SimpleLogRecordProcessor\n\nprovider = LoggerProvider()\nprovider.add_log_record_processor(SimpleLogRecordProcessor(ConsoleLogRecordExporter()))\nprovider.get_logger(\"example\").emit(body=\"Hello\", severity_text=\"INFO\")\nprovider.shutdown()",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://opentelemetry-python.readthedocs.io/en/latest/sdk/_logs.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "_logs.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F141"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sentry-sdk",
          "name": [
            {
              "t": "fact",
              "fact": "F154"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/getsentry/sentry-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sentry-sdk"
            },
            {
              "label": "Docs",
              "href": "https://docs.sentry.io/platforms/python/logs/"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "The Sentry SDK reports errors and logs from a Python application to Sentry, a hosted error tracking service. After "
            },
            {
              "t": "code",
              "text": "sentry_sdk.init"
            },
            {
              "t": "text",
              "text": " runs with a project DSN, the "
            },
            {
              "t": "code",
              "text": "sentry_sdk.logger"
            },
            {
              "t": "text",
              "text": " namespace sends structured messages whose placeholders, such as "
            },
            {
              "t": "code",
              "text": "{user_id}"
            },
            {
              "t": "text",
              "text": ", become searchable attributes. The "
            },
            {
              "t": "code",
              "text": "LoggingIntegration"
            },
            {
              "t": "text",
              "text": " captures records from the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module as Sentry logs and breadcrumbs. Records at error level and above can also become error events through the "
            },
            {
              "t": "code",
              "text": "event_level"
            },
            {
              "t": "text",
              "text": " option."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.sentry.io/platforms/python/logs/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F274"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F275"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nuclia/nucliadb",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F171"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def setup_error_handling(version: str) -> None:\n    settings = ErrorHandlingSettings()\n\n    if settings.sentry_url:\n        # Disabled everywhere for now. Let's have less knobs to tweak.\n        # Either we use with with sentry or we don't.\n        # enabled_integrations: list[Any] = [\n        #     LoggingIntegration(level=logging.CRITICAL, event_level=logging.CRITICAL)\n        # ]\n\n        sentry_sdk.init(\n            release=version,\n            environment=settings.environment,\n            dsn=settings.sentry_url,\n            integrations=[\n                LoggingIntegration(\n                    level=None,\n                ),\n            ],\n        )\n        sentry_sdk.set_tag(\"zone\", settings.zone)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nuclia/nucliadb/blob/514c0fca39afa36d80d74dd60cf865a65dc3639e/nucliadb_telemetry/src/nucliadb_telemetry/errors.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sentry-sdk%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import sentry_sdk\n\nsentry_sdk.init(dsn=\"https://<key>@o<orgId>.ingest.sentry.io/<projectId>\", enable_logs=True)\nsentry_sdk.logger.info(\"Hello\")\nsentry_sdk.flush()",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.sentry.io/platforms/python/logs/",
                  "label": [
                    {
                      "t": "text",
                      "text": "index.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F159"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "structlog",
          "name": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/hynek/structlog"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/structlog"
            },
            {
              "label": "Docs",
              "href": "https://www.structlog.org/en/stable/getting-started.html"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "structlog builds each log entry as a dictionary of key and value pairs, called an event. A configured chain of processors adds fields such as the level and a timestamp, then a renderer turns the event into JSON, logfmt, or colored console text. "
            },
            {
              "t": "code",
              "text": "structlog.get_logger"
            },
            {
              "t": "text",
              "text": " works with no setup and prints to standard output. Values bound once with "
            },
            {
              "t": "code",
              "text": "bind"
            },
            {
              "t": "text",
              "text": " or through context variables appear on every later event. The final output can also go through the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F23"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.structlog.org/en/stable/getting-started.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F173"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F30"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F31"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F32"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F33"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F34"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F35"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jrobichaud/django-structlog",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F187"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def async_streaming_content_wrapper(\n    streaming_content: AsyncIterator[bytes], context: Any\n) -> AsyncGenerator[bytes, Any]:\n    with structlog.contextvars.bound_contextvars(**context):\n        logger.log(app_settings.REQUEST_STARTED_LOG_LEVEL, \"streaming_started\")\n        try:\n            async for chunk in streaming_content:\n                yield chunk\n        except asyncio.CancelledError:\n            logger.log(app_settings.REQUEST_CANCELLED_LOG_LEVEL, \"streaming_cancelled\")\n            raise\n        except Exception:\n            logger.exception(\"streaming_failed\")\n            raise\n        else:\n            logger.log(app_settings.STATUS_2XX_LOG_LEVEL, \"streaming_finished\")",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jrobichaud/django-structlog/blob/37617a65b2af9efcb7099c22db0bc1a06415d745/django_structlog/middlewares/request.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F186"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20structlog%20for%20logging%20configuration%2C%20request%20context%2C%20structured%20events%20and%20exception%20output&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F173"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import structlog\nlog = structlog.get_logger()\nlog.info(\"hello, %s!\", \"world\", key=\"value!\", more_than_strings=[1, 2, 3])",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.structlog.org/en/stable/getting-started.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "getting-started.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F178"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-json-logger",
          "name": [
            {
              "t": "fact",
              "fact": "F189"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/nhairs/python-json-logger"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/python-json-logger"
            },
            {
              "label": "Docs",
              "href": "https://nhairs.github.io/python-json-logger/latest/quickstart/"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Python JSON Logger supplies formatter classes for the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module that encode each record as JSON. "
            },
            {
              "t": "code",
              "text": "JsonFormatter"
            },
            {
              "t": "text",
              "text": " attaches to any existing handler through "
            },
            {
              "t": "code",
              "text": "setFormatter"
            },
            {
              "t": "text",
              "text": ". The "
            },
            {
              "t": "code",
              "text": "fmt"
            },
            {
              "t": "text",
              "text": " argument sets the fields and accepts the same format styles as "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": ". Messages can also be dictionaries, and values passed through "
            },
            {
              "t": "code",
              "text": "extra"
            },
            {
              "t": "text",
              "text": " become fields of the JSON object."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://nhairs.github.io/python-json-logger/latest/quickstart/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F189"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F276"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F277"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/PrefectHQ/prefect",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F205"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def add_fields(\n    self,\n    log_record: dict[str, object],\n    record: logging.LogRecord,\n    message_dict: dict[str, object],\n) -> None:\n    super().add_fields(log_record, record, message_dict)\n\n    if self._refkey and hasattr(record, \"k8s_ref\"):\n        ref = getattr(record, \"k8s_ref\")\n        log_record[self._refkey] = ref\n\n    if \"severity\" not in log_record:\n        log_record[\"severity\"] = (\n            \"debug\"\n            if record.levelno <= logging.DEBUG\n            else \"info\"\n            if record.levelno <= logging.INFO\n            else \"warn\"\n            if record.levelno <= logging.WARNING\n            else \"error\"\n            if record.levelno <= logging.ERROR\n            else \"fatal\"\n        )",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/PrefectHQ/prefect/blob/ec4b188a19371cb79bc91afe897042bca3a3c95f/src/integrations/prefect-kubernetes/prefect_kubernetes/_logging.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=python-json-logger%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F189"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import logging\nfrom pythonjsonlogger.json import JsonFormatter\n\nlogger = logging.getLogger()\n\nlogHandler = logging.StreamHandler()\nformatter = JsonFormatter()\nlogHandler.setFormatter(formatter)\nlogger.addHandler(logHandler)\n\nlogger.warning(\"Hello\")",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://nhairs.github.io/python-json-logger/latest/quickstart/",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F194"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "loguru",
          "name": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Delgan/loguru"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/loguru"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/pypi/loguru/0.8.0/json"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "Loguru replaces the setup of the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module with one preconfigured "
            },
            {
              "t": "code",
              "text": "logger"
            },
            {
              "t": "text",
              "text": " that writes to standard error on import. The "
            },
            {
              "t": "code",
              "text": "add"
            },
            {
              "t": "text",
              "text": " method registers each destination, called a sink, which can be a file path, a function, a file object, or a standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " handler. File sinks take rotation, retention, and compression settings. With "
            },
            {
              "t": "code",
              "text": "serialize"
            },
            {
              "t": "text",
              "text": " set, each record reaches the sink as a JSON string, and "
            },
            {
              "t": "code",
              "text": "bind"
            },
            {
              "t": "text",
              "text": " attaches fields to later messages."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F47"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/loguru/0.8.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F207"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F55"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F56"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F57"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F58"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F59"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F60"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/FoundationAgents/MetaGPT",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def define_log_level(print_level=\"INFO\", logfile_level=\"DEBUG\", name: str = None):\n    \"\"\"Adjust the log level to above level\"\"\"\n    global _print_level\n    _print_level = print_level\n\n    current_date = datetime.now()\n    formatted_date = current_date.strftime(\"%Y%m%d\")\n    log_name = f\"{name}_{formatted_date}\" if name else formatted_date  # name a log with prefix name\n\n    _logger.remove()\n    _logger.add(sys.stderr, level=print_level)\n    _logger.add(METAGPT_ROOT / f\"logs/{log_name}.txt\", level=logfile_level)\n    return _logger",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/logs.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20loguru%20for%20logging%20configuration%2C%20request%20context%2C%20structured%20events%20and%20exception%20output&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F207"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from loguru import logger\n\nlogger.debug(\"That's it, beautiful and simple logging!\")",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/loguru/0.8.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F212"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "colorlog",
          "name": [
            {
              "t": "fact",
              "fact": "F224"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/borntyping/python-colorlog"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/colorlog"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/pypi/colorlog/6.12.0/json"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "colorlog adds color to the output of the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module. Its "
            },
            {
              "t": "code",
              "text": "ColoredFormatter"
            },
            {
              "t": "text",
              "text": " class extends "
            },
            {
              "t": "code",
              "text": "logging.Formatter"
            },
            {
              "t": "text",
              "text": " and replaces the formatter on any existing handler. A "
            },
            {
              "t": "code",
              "text": "log_colors"
            },
            {
              "t": "text",
              "text": " mapping assigns a color to each level name, and "
            },
            {
              "t": "code",
              "text": "secondary_log_colors"
            },
            {
              "t": "text",
              "text": " colors other parts of the format string. On Windows, colorama installs as a dependency so that the colors display."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/colorlog/6.12.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F224"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F278"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F279"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F280"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F281"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/optuna/optuna",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F240"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_default_formatter() -> logging.Formatter:\n    \"\"\"Create a default formatter of log messages.\n\n    This function is not supposed to be directly accessed by library users.\n    \"\"\"\n    header = \"[%(levelname)1.1s %(asctime)s]\"\n    message = \"%(message)s\"\n    return colorlog.TTYColoredFormatter(\n        f\"%(log_color)s{header}%(reset)s {message}\",\n        stream=sys.stderr,\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/optuna/optuna/blob/0abf066c1e5d9d83987986869daa3c2bb23df519/optuna/logging.py#L31-L41",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F239"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=colorlog%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F224"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import logging\nimport colorlog\n\nhandler = colorlog.StreamHandler()\nhandler.setFormatter(colorlog.ColoredFormatter(\"%(log_color)s%(levelname)s:%(name)s:%(message)s\"))\nlogger = colorlog.getLogger(\"example\")\nlogger.addHandler(handler)\nlogger.setLevel(logging.INFO)\nlogger.info(\"Hello\")",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/colorlog/6.12.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "coloredlogs",
          "name": [
            {
              "t": "fact",
              "fact": "F242"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/xolox/python-coloredlogs"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/coloredlogs"
            },
            {
              "label": "Docs",
              "href": "https://coloredlogs.readthedocs.io/en/latest/api.html"
            }
          ],
          "what": [
            {
              "t": "text",
              "text": "coloredlogs colors terminal output from the standard "
            },
            {
              "t": "code",
              "text": "logging"
            },
            {
              "t": "text",
              "text": " module with ANSI escape sequences. One call to "
            },
            {
              "t": "code",
              "text": "coloredlogs.install"
            },
            {
              "t": "text",
              "text": " adds a colored handler to the root logger. The "
            },
            {
              "t": "code",
              "text": "ColoredFormatter"
            },
            {
              "t": "text",
              "text": " class inherits from "
            },
            {
              "t": "code",
              "text": "logging.Formatter"
            },
            {
              "t": "text",
              "text": " for setups that attach their own handlers. On Windows, the package tries native ANSI support first and falls back on colorama when it is installed."
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://coloredlogs.readthedocs.io/en/latest/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F242"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F282"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F283"
                }
              ]
            }
          ],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nccgroup/ScoutSuite",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F258"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def set_logger_configuration(is_debug=False, quiet=False, output_file_path=None):\n    \"\"\"\n    Configure whether full stacktraces should be dumped in the console output\n    \"\"\"\n\n    # set debug level\n    global verbose_exceptions\n    verbose_exceptions = is_debug\n\n    # if \"quiet\" is set, don't output anything\n    if quiet:\n        coloredlogs.install(level='ERROR', logger=logger)\n    else:\n        coloredlogs.install(level='DEBUG' if is_debug else 'INFO', logger=logger)\n\n    if output_file_path:\n        # For some reason, hostname information is not passed to the FileHandler\n        # Add it using a filter\n        class HostnameFilter(logging.Filter):\n            hostname = platform.node()\n\n            def filter(self, record):\n                record.hostname = HostnameFilter.hostname\n                return True\n\n        # create file handler which logs messages\n        fh = logging.FileHandler(output_file_path, 'w+')\n        # Add filter to add hostname information\n        fh.addFilter(HostnameFilter())\n        # create formatter and add it to the handlers\n        formatter = logging.Formatter(fmt='%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s',\n                                      datefmt='%Y-%m-%d %H:%M:%S')\n        fh.setFormatter(formatter)\n        # add the handlers to the logger\n        logger.addHandler(fh)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nccgroup/ScoutSuite/blob/7909f2fc6186063e5c9e7ddef8c4d7d1072c8f3d/ScoutSuite/core/console.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F257"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=coloredlogs%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F242"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import coloredlogs, logging\n\ncoloredlogs.install(level=\"DEBUG\")\nlogger = logging.getLogger(\"some.module.name\")\nlogger.info(\"this is an informational message\")",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://coloredlogs.readthedocs.io/en/latest/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F247"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python logging library should I use?",
      "a": [
        {
          "t": "text",
          "text": "The standard "
        },
        {
          "t": "code",
          "text": "logging"
        },
        {
          "t": "text",
          "text": " module ships with Python, and most libraries here plug into it. "
        },
        {
          "t": "link",
          "href": "#richhandler",
          "label": [
            {
              "t": "text",
              "text": "Rich"
            }
          ]
        },
        {
          "t": "text",
          "text": ", "
        },
        {
          "t": "link",
          "href": "#colorlog",
          "label": [
            {
              "t": "text",
              "text": "colorlog"
            }
          ]
        },
        {
          "t": "text",
          "text": ", and "
        },
        {
          "t": "link",
          "href": "#coloredlogs",
          "label": [
            {
              "t": "text",
              "text": "coloredlogs"
            }
          ]
        },
        {
          "t": "text",
          "text": " add color, and "
        },
        {
          "t": "link",
          "href": "#python-json-logger",
          "label": [
            {
              "t": "text",
              "text": "Python JSON Logger"
            }
          ]
        },
        {
          "t": "text",
          "text": " adds JSON, with no change to existing log calls. "
        },
        {
          "t": "link",
          "href": "#loguru",
          "label": [
            {
              "t": "text",
              "text": "Loguru"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#structlog",
          "label": [
            {
              "t": "text",
              "text": "structlog"
            }
          ]
        },
        {
          "t": "text",
          "text": " replace the setup with their own logger API."
        }
      ]
    },
    {
      "q": "Loguru vs logging: what is the difference?",
      "a": [
        {
          "t": "text",
          "text": "Loguru provides one preconfigured "
        },
        {
          "t": "code",
          "text": "logger"
        },
        {
          "t": "text",
          "text": ", and its "
        },
        {
          "t": "code",
          "text": "add"
        },
        {
          "t": "text",
          "text": " method registers each output, called a sink, in place of the handlers, formatters, and filters that "
        },
        {
          "t": "code",
          "text": "logging"
        },
        {
          "t": "text",
          "text": " uses. File sinks take rotation, retention, and compression settings directly."
        }
      ]
    },
    {
      "q": "structlog vs Loguru: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "structlog builds each event as a dictionary that passes through a chain of processors, then renders JSON, logfmt, or console output, or hands the event to "
        },
        {
          "t": "code",
          "text": "logging"
        },
        {
          "t": "text",
          "text": ". Loguru keeps a single logger that sends message records to sinks, and writes JSON when a sink sets "
        },
        {
          "t": "code",
          "text": "serialize"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "q": "How do I log JSON in Python?",
      "a": [
        {
          "t": "link",
          "href": "#python-json-logger",
          "label": [
            {
              "t": "text",
              "text": "Python JSON Logger"
            }
          ]
        },
        {
          "t": "text",
          "text": " adds a JSON formatter to existing "
        },
        {
          "t": "code",
          "text": "logging"
        },
        {
          "t": "text",
          "text": " handlers. "
        },
        {
          "t": "link",
          "href": "#structlog",
          "label": [
            {
              "t": "text",
              "text": "structlog"
            }
          ]
        },
        {
          "t": "text",
          "text": " renders JSON with "
        },
        {
          "t": "code",
          "text": "JSONRenderer"
        },
        {
          "t": "text",
          "text": ", and "
        },
        {
          "t": "link",
          "href": "#loguru",
          "label": [
            {
              "t": "text",
              "text": "Loguru"
            }
          ]
        },
        {
          "t": "text",
          "text": " writes JSON when a sink sets "
        },
        {
          "t": "code",
          "text": "serialize"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "q": "How do I use Rich with Python logging?",
      "a": [
        {
          "t": "text",
          "text": "Pass "
        },
        {
          "t": "code",
          "text": "RichHandler()"
        },
        {
          "t": "text",
          "text": " in the "
        },
        {
          "t": "code",
          "text": "handlers"
        },
        {
          "t": "text",
          "text": " list of "
        },
        {
          "t": "code",
          "text": "logging.basicConfig"
        },
        {
          "t": "text",
          "text": ". Setting "
        },
        {
          "t": "code",
          "text": "rich_tracebacks"
        },
        {
          "t": "text",
          "text": " on the handler formats exceptions with Rich's traceback renderer."
        }
      ]
    },
    {
      "q": "Can Python log files rotate by size or time?",
      "a": [
        {
          "t": "text",
          "text": "The standard library includes "
        },
        {
          "t": "code",
          "text": "RotatingFileHandler"
        },
        {
          "t": "text",
          "text": " for size and "
        },
        {
          "t": "code",
          "text": "TimedRotatingFileHandler"
        },
        {
          "t": "text",
          "text": " for time. "
        },
        {
          "t": "link",
          "href": "#loguru",
          "label": [
            {
              "t": "text",
              "text": "Loguru"
            }
          ]
        },
        {
          "t": "text",
          "text": " takes a "
        },
        {
          "t": "code",
          "text": "rotation"
        },
        {
          "t": "text",
          "text": " setting on each file sink."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, rich",
      "display": "RichHandler",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, rich",
      "display": "552.8M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, rich",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, rich",
      "display": "15.0.0, Apr 2026",
      "asOf": "2026-04-12"
    },
    "F5": {
      "label": "Package release date, rich",
      "display": "Apr 2026",
      "asOf": "2026-04-12"
    },
    "F6": {
      "label": "Repository stars, rich",
      "display": "57.8K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Exception tracebacks, rich",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Output formats, rich",
      "display": "Text",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Install, rich",
      "display": "pip install rich",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "What it does, rich",
      "display": "Formats and colorizes standard-library logging output with Rich.",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "strengths lead, rich",
      "display": "Keeps standard logging APIs",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths, rich",
      "display": "Attach RichHandler to the standard logging configuration.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, rich",
      "display": "Formats detailed exception tracebacks",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, rich",
      "display": "Enable rich_tracebacks to render exceptions through Rich’s traceback formatter.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "limitations lead, rich",
      "display": "Markup is disabled by default",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations, rich",
      "display": "Enable markup only when log messages intentionally contain Rich markup.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "Quickstart, rich",
      "display": "import logging\nfrom rich.logging import RichHandler\n\nlogging.basicConfig(\n    level=\"NOTSET\",\n    format=\"%(message)s\",\n    datefmt=\"[%X]\",\n    handlers=[RichHandler(rich_tracebacks=True)]\n)\n\nlog = logging.getLogger(\"rich\")\ntry:\n    print(1 / 0)\nexcept Exception:\n    log.exception(\"unable print!\")\n\n",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "Library name, structlog",
      "display": "structlog",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "Monthly downloads, structlog",
      "display": "119.6M",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "License, structlog",
      "display": "MIT OR Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Package release, structlog",
      "display": "26.1.0, Jun 2026",
      "asOf": "2026-06-06"
    },
    "F22": {
      "label": "Package release date, structlog",
      "display": "Jun 2026",
      "asOf": "2026-06-06"
    },
    "F23": {
      "label": "Repository stars, structlog",
      "display": "5.0K",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Structured JSON, structlog",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Context fields, structlog",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Exception tracebacks, structlog",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Output formats, structlog",
      "display": "JSON",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Install, structlog",
      "display": "pip install structlog",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "What it does, structlog",
      "display": "Builds structured log events through bound context and processor chains.",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "strengths lead, structlog",
      "display": "Processes structured event dictionaries",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "strengths, structlog",
      "display": "Choose processors and a renderer for the desired event output.",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "strengths lead, structlog",
      "display": "Binds request-local log context",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "strengths, structlog",
      "display": "Merge context variables into events and bind request fields once.",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "limitations lead, structlog",
      "display": "Request context needs explicit reset",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "limitations, structlog",
      "display": "Clear context variables at request entry before binding the next request’s fields.",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Quickstart, structlog",
      "display": "import structlog\nlog = structlog.get_logger()\nlog.info(\"hello, %s!\", \"world\", key=\"value!\", more_than_strings=[1, 2, 3])\n",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Project function, structlog",
      "display": "def sync_streaming_content_wrapper(\n    streaming_content: Iterator[bytes], context: Any\n) -> Generator[bytes, None, None]:\n    with structlog.contextvars.bound_contextvars(**context):\n        logger.log(app_settings.REQUEST_STARTED_LOG_LEVEL, \"streaming_started\")\n        try:\n            yield from streaming_content\n        except Exception:\n            logger.exception(\"streaming_failed\")\n            raise\n        else:\n            logger.log(app_settings.STATUS_2XX_LOG_LEVEL, \"streaming_finished\")\n",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Project function reference, structlog",
      "display": "request.py · sync_streaming_content_wrapper()",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "Project repository, structlog",
      "display": "jrobichaud/django-structlog",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "Project stars, jrobichaud/django-structlog",
      "display": "530",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "Project push date, jrobichaud/django-structlog",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F42": {
      "label": "Library name, loguru",
      "display": "Loguru",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Monthly downloads, loguru",
      "display": "81.2M",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "License, loguru",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Package release, loguru",
      "display": "0.8.0, Nov 2026",
      "asOf": "2026-11-11"
    },
    "F46": {
      "label": "Package release date, loguru",
      "display": "Nov 2026",
      "asOf": "2026-11-11"
    },
    "F47": {
      "label": "Repository stars, loguru",
      "display": "24.2K",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Structured JSON, loguru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Context fields, loguru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Exception tracebacks, loguru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "File rotation, loguru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Output formats, loguru",
      "display": "JSON",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Install, loguru",
      "display": "pip install loguru",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "What it does, loguru",
      "display": "Provides a configurable logger with sinks, contextual records, and exception handling.",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "strengths lead, loguru",
      "display": "Manages rotating log sinks",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "strengths, loguru",
      "display": "Configure file rotation, retention, and compression on the logger.",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "strengths lead, loguru",
      "display": "Serializes structured log events",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "strengths, loguru",
      "display": "Enable serialize to send JSON-formatted records to the configured sink.",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "limitations lead, loguru",
      "display": "Diagnostics include variable values",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "limitations, loguru",
      "display": "Set diagnose=False when production tracebacks must omit local variable values.",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Quickstart, loguru",
      "display": "from loguru import logger\n\nlogger.debug(\"That's it, beautiful and simple logging!\")\n\nlogger.add(\"file_{time}.log\")\n\nlogger.add(\"file_1.log\", rotation=\"500 MB\")    # Automatically rotate too big file\nlogger.add(\"file_2.log\", rotation=\"12:00\")     # New file is created each day at noon\nlogger.add(\"file_3.log\", rotation=\"1 week\")    # Once the file is too old, it's rotated\n\nlogger.add(\"file_X.log\", retention=\"10 days\")  # Cleanup after some time\n\nlogger.add(\"file_Y.log\", compression=\"zip\")    # Save some loved space\n\n@logger.catch\ndef my_function(x, y, z):\n    # An error? It's caught anyway!\n    return 1 / (x + y + z)\n\nlogger.add(\"file.log\", format=\"{extra[ip]} {extra[user]} {message}\")\ncontext_logger = logger.bind(ip=\"192.168.0.1\", user=\"someone\")\ncontext_logger.info(\"Contextualize your logger easily\")\ncontext_logger.bind(user=\"someone_else\").info(\"Inline binding of extra attribute\")\ncontext_logger.info(\"Use kwargs to add context during formatting: {user}\", user=\"anybody\")\n",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Project function, loguru",
      "display": "def define_log_level(print_level=\"INFO\", logfile_level=\"DEBUG\", name: str = None):\n    \"\"\"Adjust the log level to above level\"\"\"\n    global _print_level\n    _print_level = print_level\n\n    current_date = datetime.now()\n    formatted_date = current_date.strftime(\"%Y%m%d\")\n    log_name = f\"{name}_{formatted_date}\" if name else formatted_date  # name a log with prefix name\n\n    _logger.remove()\n    _logger.add(sys.stderr, level=print_level)\n    _logger.add(METAGPT_ROOT / f\"logs/{log_name}.txt\", level=logfile_level)\n    return _logger\n",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "Project function reference, loguru",
      "display": "logs.py · define_log_level()",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Project repository, loguru",
      "display": "FoundationAgents/MetaGPT",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "Project stars, FoundationAgents/MetaGPT",
      "display": "71.3K",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Project push date, FoundationAgents/MetaGPT",
      "display": "Jan 2026",
      "asOf": "2026-01-21"
    },
    "F67": {
      "label": "Library name, logging",
      "display": "logging",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Monthly downloads, logging",
      "display": "Standard library",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "License, logging",
      "display": "PSF License Version 2",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Package release, logging",
      "display": "With Python",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Undated package release, logging",
      "display": "With Python",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Repository context, logging",
      "display": "Part of Python",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Context fields, logging",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Exception tracebacks, logging",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "File rotation, logging",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Output formats, logging",
      "display": "Text",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Install, logging",
      "display": "python -c \"import logging\"",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "What it does, logging",
      "display": "Provides Python’s bundled logging framework.",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "strengths lead, logging",
      "display": "Ships with Python",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "strengths, logging",
      "display": "Configure hierarchical loggers, handlers, and formatters without installing another package.",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "strengths lead, logging",
      "display": "Includes rotating file handlers",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "strengths, logging",
      "display": "Rotate log files by size or time with standard-library handlers.",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "limitations lead, logging",
      "display": "Existing handlers block basicConfig changes",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "limitations, logging",
      "display": "Use force=True when replacing an already configured root logger.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Quickstart, logging",
      "display": "import glob\nimport logging\nimport logging.handlers\n\nLOG_FILENAME = 'logging_rotatingfile_example.out'\n\n# Set up a specific logger with our desired output level\nmy_logger = logging.getLogger('MyLogger')\nmy_logger.setLevel(logging.DEBUG)\n\n# Add the log message handler to the logger\nhandler = logging.handlers.RotatingFileHandler(\n              LOG_FILENAME, maxBytes=20, backupCount=5)\n\nmy_logger.addHandler(handler)\n\n# Log some messages\nfor i in range(20):\n    my_logger.debug('i = %d' % i)\n\n# See what files are created\nlogfiles = glob.glob('%s*' % LOG_FILENAME)\n\nfor filename in logfiles:\n    print(filename)\n\n",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Project function, logging",
      "display": "def format(self, record):\n    msg = record.msg\n    status_code = getattr(record, \"status_code\", None)\n\n    if status_code:\n        if 200 <= status_code < 300:\n            # Put 2XX first, since it should be the common case\n            msg = self.style.HTTP_SUCCESS(msg)\n        elif 100 <= status_code < 200:\n            msg = self.style.HTTP_INFO(msg)\n        elif status_code == 304:\n            msg = self.style.HTTP_NOT_MODIFIED(msg)\n        elif 300 <= status_code < 400:\n            msg = self.style.HTTP_REDIRECT(msg)\n        elif status_code == 404:\n            msg = self.style.HTTP_NOT_FOUND(msg)\n        elif 400 <= status_code < 500:\n            msg = self.style.HTTP_BAD_REQUEST(msg)\n        else:\n            # Any 5XX, or any other status code\n            msg = self.style.HTTP_SERVER_ERROR(msg)\n\n    if self.uses_server_time() and not hasattr(record, \"server_time\"):\n        record.server_time = self.formatTime(record, self.datefmt)\n\n    record.msg = msg\n    return super().format(record)\n",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Project function reference, logging",
      "display": "log.py · format()",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Project repository, logging",
      "display": "django/django",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Project stars, django/django",
      "display": "91.8K",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project push date, django/django",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F91": {
      "label": "Developer need",
      "display": "Bundled application logging",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Why choose logging",
      "display": "standard-library loggers, handlers, and formatters",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Developer need in introduction",
      "display": "bundled application logging",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Developer need",
      "display": "Sink rotation and structured records",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Why choose loguru",
      "display": "rotation, retention, and compression configured on the logger",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Developer need in introduction",
      "display": "sink rotation and structured records",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Structured request logging",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose structlog",
      "display": "request-local fields merged into structured events",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "structured request logging",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "When to consider logging",
      "display": "the requirement is native size/time-based file rotation",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Readable standard-library tracebacks",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose rich",
      "display": "Rich exception formatting through a standard logging handler",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "readable standard-library tracebacks",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider structlog",
      "display": "machine-readable JSON events matter more than terminal formatting",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Page introduction",
      "display": "Python logging libraries let developers record application events and errors.",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "FAQ: Which Python logging library should I choose?",
      "display": "logging belongs to Python’s bundled standard library.",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "FAQ: Which Python logging library should I choose?",
      "display": "Loguru configures rotation, retention, and compression directly on sinks.",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "FAQ: Which Python logging library should I choose?",
      "display": "structlog can render structured events as JSON.",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "FAQ: Which Python logging library should I choose?",
      "display": "RichHandler formats standard-library logging output.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Does Python logging need to be installed?",
      "display": "logging is part of Python’s distributed standard library.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Why does basicConfig leave the previous configuration in place?",
      "display": "basicConfig does nothing when root handlers already exist unless force is true.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which libraries emit structured JSON log events?",
      "display": "Loguru serialize converts the message and record to a JSON string before sending it to a sink.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which libraries emit structured JSON log events?",
      "display": "structlog exposes JSONRenderer in its processor chain.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Can exception output include local variable values?",
      "display": "Loguru diagnose controls whether traceback variables are displayed and its own production guidance disables it.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: How should request-local context be reset?",
      "display": "structlog recommends clear_contextvars at the beginning of request handling before binding new context.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Can log files rotate by size or time?",
      "display": "The standard library includes rotating file handlers.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Can log files rotate by size or time?",
      "display": "Loguru accepts rotation conditions on its configured file sink.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Why does Rich markup appear literally inside a log message?",
      "display": "RichHandler markup is disabled by default; it can be enabled for the handler or a selected message.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Is RichHandler a replacement for the logging framework?",
      "display": "RichHandler formats and colorizes text written by Python’s logging module.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "Library name, rich",
      "display": "Rich",
      "asOf": "2026-11-20"
    },
    "F121": {
      "label": "Monthly downloads, rich",
      "display": "579.9M",
      "asOf": "2026-11-20"
    },
    "F122": {
      "label": "License, rich",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F123": {
      "label": "Package release, rich",
      "display": "15.0.0",
      "asOf": "2026-11-20"
    },
    "F124": {
      "label": "Package release date, rich",
      "display": "Apr 2026",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "Install, rich",
      "display": "python3.13 -m pip install rich==15.0.0",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "Quickstart, rich",
      "display": "import logging\nfrom rich.logging import RichHandler\n\nFORMAT = \"%(message)s\"\nlogging.basicConfig(\n    level=\"NOTSET\", format=FORMAT, datefmt=\"[%X]\", handlers=[RichHandler()]\n)\n\nlog = logging.getLogger(\"rich\")\nlog.info(\"Hello, World!\")\n",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Local JSON log rendering, rich",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Colored terminal logging, rich",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Stdlib Formatter class, rich",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Logging pipeline role, rich",
      "display": "Terminal handler on Python stdlib logging, with color, source paths, and optional rich tracebacks; distribution count covers the whole Rich console/rendering package.",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Original workflow and current API boundary, rich",
      "display": "FastAPI CLI imports Console from rich.console and RichHandler from rich.logging, so both constructors belong to the selected Rich distribution. Current15.0 documentation retains the exact handler options. Console is passed only when a width was requested. setFormatter, addHandler, setLevel, and propagate are inherited stdlib operations and do not inflate the two Rich-specific constructor sites. This configures the fastapi_cli logger and enables local-variable tracebacks and markup; neither option is a default-safe policy for untrusted log content or secrets.",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Project function, rich",
      "display": "def setup_logging(terminal_width: int | None = None, level: int = logging.INFO) -> None:\n    logger = logging.getLogger(\"fastapi_cli\")\n    console = Console(width=terminal_width) if terminal_width else None\n    rich_handler = RichHandler(\n        show_time=False,\n        rich_tracebacks=True,\n        tracebacks_show_locals=True,\n        markup=True,\n        show_path=False,\n        console=console,\n    )\n    rich_handler.setFormatter(logging.Formatter(\"%(message)s\"))\n    logger.addHandler(rich_handler)\n\n    logger.setLevel(level)\n    logger.propagate = False",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Project source file, rich",
      "display": "src/fastapi_cli/logging.py",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Project full_name, rich",
      "display": "fastapi/fastapi-cli",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Project stargazers_count, rich",
      "display": "649",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Library name, opentelemetry-sdk",
      "display": "OpenTelemetry SDK",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Monthly downloads, opentelemetry-sdk",
      "display": "345.7M",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "License, opentelemetry-sdk",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Package release, opentelemetry-sdk",
      "display": "1.45.2",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Package release date, opentelemetry-sdk",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Install, opentelemetry-sdk",
      "display": "python3.13 -m pip install opentelemetry-sdk==1.45.2",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Quickstart, opentelemetry-sdk",
      "display": "from opentelemetry.sdk._logs import LoggerProvider\nfrom opentelemetry.sdk._logs.export import ConsoleLogRecordExporter, SimpleLogRecordProcessor\n\nprovider = LoggerProvider()\nprovider.add_log_record_processor(SimpleLogRecordProcessor(ConsoleLogRecordExporter()))\nprovider.get_logger(\"example\").emit(body=\"Hello\", severity_text=\"INFO\")\nprovider.shutdown()",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Official description, opentelemetry-sdk",
      "display": "OpenTelemetry Python SDK",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Quickstart source file, opentelemetry-sdk",
      "display": "_logs.html",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Local JSON log rendering, opentelemetry-sdk",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Colored terminal logging, opentelemetry-sdk",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Stdlib Formatter class, opentelemetry-sdk",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Logging pipeline role, opentelemetry-sdk",
      "display": "Provider, processors, and exporters for OpenTelemetry log records; console exporter is diagnostic JSON and remote OTLP uses separately installed exporter packages. Whole SDK counter includes traces and metrics.",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Original workflow and current API boundary, opentelemetry-sdk",
      "display": "OpenLIT imports SDKLoggerProvider, SDK Resource, Simple/BatchLogRecordProcessor, and ConsoleLogRecordExporter directly. Current1.45.2 docs and exact-tag exporter/resource source retain these constructors, add_log_record_processor, Resource.create(attributes), SERVICE_NAME, TELEMETRY_SDK_NAME, and DEPLOYMENT_ENVIRONMENT. The latter is a retained older semantic-convention key, not a claim it is the preferred current name. _logs.get_logger_provider/set_logger_provider/get_logger belong to the API peer, not extra SDK calls. OTLP exporters are separate packages with HTTP/gRPC host selection; that branch is original host context, while console branch is independently supported. A provided event_logger or existing global provider can bypass initialization; EVENTS_SET is process-global. No configuration, exporter, thread, or service ran.",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Project function, opentelemetry-sdk",
      "display": "def setup_events(\n    application_name,\n    environment,\n    event_logger,\n    otlp_endpoint,\n    otlp_headers,\n    disable_batch,\n):\n    \"\"\"Setup OpenTelemetry events with the given configuration.\n\n    Args:\n        application_name: Name of the application\n        environment: Deployment environment\n        event_logger: Optional pre-configured Logger instance\n        otlp_endpoint: Optional OTLP endpoint for exporter\n        otlp_headers: Optional headers for OTLP exporter\n\n    Returns:\n        Logger: The configured OTel Logger for emitting events as LogRecords\n    \"\"\"\n    # If an external events_logger is provided, return it immediately.\n    if event_logger:\n        return event_logger\n\n    # Proceed with setting up a new events or configuration only if EVENTS_SET is False.\n    global EVENTS_SET\n\n    try:\n        if not EVENTS_SET:\n            existing_provider = _logs.get_logger_provider()\n\n            if isinstance(existing_provider, SDKLoggerProvider):\n                logger.info(\"Detected existing LoggerProvider, reusing it\")\n            else:\n                # No SDK provider configured yet -- create one.\n                resource = Resource.create(\n                    attributes={\n                        SERVICE_NAME: application_name,\n                        DEPLOYMENT_ENVIRONMENT: environment,\n                        TELEMETRY_SDK_NAME: \"openlit\",\n                    }\n                )\n\n                logger_provider = SDKLoggerProvider(resource=resource)\n\n                if otlp_endpoint is not None:\n                    os.environ[\"OTEL_EXPORTER_OTLP_ENDPOINT\"] = otlp_endpoint\n\n                if otlp_headers is not None:\n                    if isinstance(otlp_headers, dict):\n                        headers_str = \",\".join(\n                            f\"{key}={value}\" for key, value in otlp_headers.items()\n                        )\n                    else:\n                        headers_str = otlp_headers\n\n                    os.environ[\"OTEL_EXPORTER_OTLP_HEADERS\"] = headers_str\n\n                exporters_config = parse_exporters(\"OTEL_LOGS_EXPORTER\")\n                processors_added = False\n\n                if exporters_config is not None:\n                    for exporter_name in exporters_config:\n                        if exporter_name == \"otlp\":\n                            event_exporter = OTLPLogExporter()\n                            log_processor = (\n                                BatchLogRecordProcessor(event_exporter)\n                                if not disable_batch\n                                else SimpleLogRecordProcessor(event_exporter)\n                            )\n                            logger_provider.add_log_record_processor(log_processor)\n                            processors_added = True\n                        elif exporter_name == \"console\":\n                            event_exporter = ConsoleLogRecordExporter()\n                            log_processor = SimpleLogRecordProcessor(event_exporter)\n                            logger_provider.add_log_record_processor(log_processor)\n                            processors_added = True\n                        elif exporter_name == \"none\":\n                            continue\n                        else:\n                            logger.warning(\"Unknown log exporter: %s\", exporter_name)\n\n                    if not processors_added:\n                        logger.warning(\n                            \"OTEL_LOGS_EXPORTER is set but no valid exporters \"\n                            \"configured. Log export is disabled. \"\n                            \"Valid exporters: otlp, console\"\n                        )\n                else:\n                    if os.getenv(\"OTEL_EXPORTER_OTLP_ENDPOINT\"):\n                        event_exporter = OTLPLogExporter()\n                        # pylint: disable=line-too-long\n                        log_processor = (\n                            BatchLogRecordProcessor(event_exporter)\n                            if not disable_batch\n                            else SimpleLogRecordProcessor(event_exporter)\n                        )\n                    else:\n                        event_exporter = ConsoleLogRecordExporter()\n                        log_processor = SimpleLogRecordProcessor(event_exporter)\n\n                    logger_provider.add_log_record_processor(log_processor)\n\n                _logs.set_logger_provider(logger_provider)\n\n            EVENTS_SET = True\n\n        return _logs.get_logger(__name__)\n\n    except Exception as e:\n        logger.error(\"Failed to setup OpenTelemetry events: %s\", e, exc_info=True)\n        return None",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Project source file, opentelemetry-sdk",
      "display": "sdk/python/src/openlit/otel/events.py",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Project full_name, opentelemetry-sdk",
      "display": "openlit/openlit",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project stargazers_count, opentelemetry-sdk",
      "display": "3.1K",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Library name, sentry-sdk",
      "display": "Sentry SDK",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Monthly downloads, sentry-sdk",
      "display": "157.9M",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "License, sentry-sdk",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Package release, sentry-sdk",
      "display": "2.75.0",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Package release date, sentry-sdk",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Install, sentry-sdk",
      "display": "python3.13 -m pip install sentry-sdk==2.75.0",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Quickstart, sentry-sdk",
      "display": "import sentry_sdk\n\nsentry_sdk.init(dsn=\"https://<key>@o<orgId>.ingest.sentry.io/<projectId>\", enable_logs=True)\nsentry_sdk.logger.info(\"Hello\")\nsentry_sdk.flush()",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Official description, sentry-sdk",
      "display": "Python client for Sentry (https://sentry.io)",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Quickstart source file, sentry-sdk",
      "display": "logs/index.html",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Local JSON log rendering, sentry-sdk",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Colored terminal logging, sentry-sdk",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Stdlib Formatter class, sentry-sdk",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Logging pipeline role, sentry-sdk",
      "display": "Send structured logs, breadcrumbs, and errors to a Sentry project. Remote searchable records and error-event thresholds are separate features; whole SDK counter includes nonlogging monitoring.",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Original workflow and current API boundary, sentry-sdk",
      "display": "NucliaDB imports the actual installed sentry_sdk and LoggingIntegration when available; fallback classes are only the ImportError path and never counted as SDK operations. setup_error_handling constructs LoggingIntegration(level=None), initializes Sentry using DSN/environment/release, and sets a zone tag. Exact2.75.0 integration source proves level is the breadcrumb threshold, event_level defaults separately, and sentry_logs_level exists. This function does not enable structured Sentry Logs and is an error/breadcrumb integration setup workflow, not an example of direct sentry_sdk.logger records. Public website integration page currently describes3.x with renamed options/defaults; it is not substituted for selected2.75.0 behavior. Actual source Apache header plus immutable full Apache terms retained alongside root scope agreement/AGPL text; no blanket inference from GitHub license metadata.",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Selected SDK documentation version, sentry-sdk",
      "display": "{\"selected\": \"2.75.0\", \"generic_integration_page\": \"3.x\", \"selected_breadcrumb_keyword\": \"level\", \"selected_structured_logs_keyword\": \"sentry_logs_level\", \"structured_logs_enable\": \"enable_logs=True\"}",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Project function, sentry-sdk",
      "display": "def setup_error_handling(version: str) -> None:\n    settings = ErrorHandlingSettings()\n\n    if settings.sentry_url:\n        # Disabled everywhere for now. Let's have less knobs to tweak.\n        # Either we use with with sentry or we don't.\n        # enabled_integrations: list[Any] = [\n        #     LoggingIntegration(level=logging.CRITICAL, event_level=logging.CRITICAL)\n        # ]\n\n        sentry_sdk.init(\n            release=version,\n            environment=settings.environment,\n            dsn=settings.sentry_url,\n            integrations=[\n                LoggingIntegration(\n                    level=None,\n                ),\n            ],\n        )\n        sentry_sdk.set_tag(\"zone\", settings.zone)",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Project source file, sentry-sdk",
      "display": "nucliadb_telemetry/src/nucliadb_telemetry/errors.py",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Project full_name, sentry-sdk",
      "display": "nuclia/nucliadb",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Project stargazers_count, sentry-sdk",
      "display": "723",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Library name, structlog",
      "display": "structlog",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Monthly downloads, structlog",
      "display": "128.0M",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "License, structlog",
      "display": "MIT OR Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Package release, structlog",
      "display": "26.1.0",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Package release date, structlog",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Install, structlog",
      "display": "python3.13 -m pip install structlog==26.1.0",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Quickstart, structlog",
      "display": "import structlog\nlog = structlog.get_logger()\nlog.info(\"hello, %s!\", \"world\", key=\"value!\", more_than_strings=[1, 2, 3])",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Local JSON log rendering, structlog",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Colored terminal logging, structlog",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Stdlib Formatter class, structlog",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Logging pipeline role, structlog",
      "display": "Structured event dictionaries processed into JSON, logfmt, or colored console output; can delegate output to stdlib logging and bind request/task context.",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Original workflow and current API boundary, structlog",
      "display": "django-structlog imports structlog and obtains logger with get_logger in the retained module. Current26.1 docs support bound_contextvars(**context), BoundLogger.log(level,event), and exception(event). The whole async generator scopes context across yielded streaming chunks, logs cancellation/error paths, and re-raises original exceptions; this is not a standalone Django application. Only actual structlog logger/context operations count; async iteration and Django request helpers are host operations.",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Project function, structlog",
      "display": "async def async_streaming_content_wrapper(\n    streaming_content: AsyncIterator[bytes], context: Any\n) -> AsyncGenerator[bytes, Any]:\n    with structlog.contextvars.bound_contextvars(**context):\n        logger.log(app_settings.REQUEST_STARTED_LOG_LEVEL, \"streaming_started\")\n        try:\n            async for chunk in streaming_content:\n                yield chunk\n        except asyncio.CancelledError:\n            logger.log(app_settings.REQUEST_CANCELLED_LOG_LEVEL, \"streaming_cancelled\")\n            raise\n        except Exception:\n            logger.exception(\"streaming_failed\")\n            raise\n        else:\n            logger.log(app_settings.STATUS_2XX_LOG_LEVEL, \"streaming_finished\")",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Project source file, structlog",
      "display": "django_structlog/middlewares/request.py",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Project full_name, structlog",
      "display": "jrobichaud/django-structlog",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Project stargazers_count, structlog",
      "display": "530",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Library name, python-json-logger",
      "display": "Python JSON Logger",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Monthly downloads, python-json-logger",
      "display": "106.9M",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "License, python-json-logger",
      "display": "BSD-2-Clause",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Package release, python-json-logger",
      "display": "4.2.0",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Package release date, python-json-logger",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Install, python-json-logger",
      "display": "python3.13 -m pip install python-json-logger==4.2.0",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Quickstart, python-json-logger",
      "display": "import logging\nfrom pythonjsonlogger.json import JsonFormatter\n\nlogger = logging.getLogger()\n\nlogHandler = logging.StreamHandler()\nformatter = JsonFormatter()\nlogHandler.setFormatter(formatter)\nlogger.addHandler(logHandler)\n\nlogger.warning(\"Hello\")",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Official description, python-json-logger",
      "display": "JSON Log Formatter for the Python Logging Package",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Quickstart source file, python-json-logger",
      "display": "quickstart/index.html",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Local JSON log rendering, python-json-logger",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Colored terminal logging, python-json-logger",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Stdlib Formatter class, python-json-logger",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Logging pipeline role, python-json-logger",
      "display": "JSON Formatter classes plugged into existing stdlib handlers, with field inclusion/renaming and supported JSON-encoder choices; not a replacement logger or sink manager.",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Original workflow and current API boundary, python-json-logger",
      "display": "Prefect Kubernetes imports JsonFormatter from pythonjsonlogger.json and inherits it as KopfObjectJsonFormatter. Whole add_fields override calls the inherited native add_fields with three positional arguments, then adds Kubernetes reference and severity fields. Current4.2 names the first argument log_data instead of log_record; positional forwarding remains valid. Do not claim keyword log_record= remains valid. The companion constructor forwards RESERVED_ATTRS as a set/sequence and timestamp=True, both documented current BaseJsonFormatter options; its module is retained as host context. One-call24-line task-specific override qualifies the bounded exception; dictionary operations and logging.LogRecord fields do not inflate native calls.",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Project function, python-json-logger",
      "display": "def add_fields(\n    self,\n    log_record: dict[str, object],\n    record: logging.LogRecord,\n    message_dict: dict[str, object],\n) -> None:\n    super().add_fields(log_record, record, message_dict)\n\n    if self._refkey and hasattr(record, \"k8s_ref\"):\n        ref = getattr(record, \"k8s_ref\")\n        log_record[self._refkey] = ref\n\n    if \"severity\" not in log_record:\n        log_record[\"severity\"] = (\n            \"debug\"\n            if record.levelno <= logging.DEBUG\n            else \"info\"\n            if record.levelno <= logging.INFO\n            else \"warn\"\n            if record.levelno <= logging.WARNING\n            else \"error\"\n            if record.levelno <= logging.ERROR\n            else \"fatal\"\n        )",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Project source file, python-json-logger",
      "display": "src/integrations/prefect-kubernetes/prefect_kubernetes/_logging.py",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Project full_name, python-json-logger",
      "display": "PrefectHQ/prefect",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Project stargazers_count, python-json-logger",
      "display": "24.2K",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Library name, loguru",
      "display": "Loguru",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Monthly downloads, loguru",
      "display": "85.4M",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "License, loguru",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release, loguru",
      "display": "0.8.0",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Package release date, loguru",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Install, loguru",
      "display": "python3.13 -m pip install loguru==0.8.0",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Quickstart, loguru",
      "display": "from loguru import logger\n\nlogger.debug(\"That's it, beautiful and simple logging!\")",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Local JSON log rendering, loguru",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Colored terminal logging, loguru",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Stdlib Formatter class, loguru",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Logging pipeline role, loguru",
      "display": "Preconfigured logger with add/remove sinks, JSON serialization, colored output, and file rotation/retention/compression; own sink API differs from stdlib Formatter configuration.",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Original workflow and current API boundary, loguru",
      "display": "MetaGPT imports logger as _logger from loguru. Current0.8 docs retain remove() with no handler id to remove every configured sink, add(sys.stderr,level=...), and add(Path,level=...). Both levels are application inputs; file path and dated filename use the original MetaGPT host constants. This resets process-wide Loguru sinks and writes a file only when actually called. No claim of isolated logger state, rotation configuration, runtime success, or current MetaGPT adoption is inferred from this historical immutable consumer.",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Native sink/file lifecycle, loguru",
      "display": "{\"rotation\": \"size,time,or callable\", \"retention\": \"count,age,or callable\", \"compression\": \"named archive format or callable\", \"sink_state\": \"shared preconfigured global logger\"}",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project function, loguru",
      "display": "def define_log_level(print_level=\"INFO\", logfile_level=\"DEBUG\", name: str = None):\n    \"\"\"Adjust the log level to above level\"\"\"\n    global _print_level\n    _print_level = print_level\n\n    current_date = datetime.now()\n    formatted_date = current_date.strftime(\"%Y%m%d\")\n    log_name = f\"{name}_{formatted_date}\" if name else formatted_date  # name a log with prefix name\n\n    _logger.remove()\n    _logger.add(sys.stderr, level=print_level)\n    _logger.add(METAGPT_ROOT / f\"logs/{log_name}.txt\", level=logfile_level)\n    return _logger",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Project source file, loguru",
      "display": "metagpt/logs.py",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Project full_name, loguru",
      "display": "FoundationAgents/MetaGPT",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Project stargazers_count, loguru",
      "display": "71.3K",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Library name, colorlog",
      "display": "colorlog",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Monthly downloads, colorlog",
      "display": "48.6M",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "License, colorlog",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Package release, colorlog",
      "display": "6.12.0",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Package release date, colorlog",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Install, colorlog",
      "display": "python3.13 -m pip install colorlog==6.12.0",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Quickstart, colorlog",
      "display": "import logging\nimport colorlog\n\nhandler = colorlog.StreamHandler()\nhandler.setFormatter(colorlog.ColoredFormatter(\"%(log_color)s%(levelname)s:%(name)s:%(message)s\"))\nlogger = colorlog.getLogger(\"example\")\nlogger.addHandler(handler)\nlogger.setLevel(logging.INFO)\nlogger.info(\"Hello\")",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Official description, colorlog",
      "display": "Add colours to the output of Python's logging module.",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Quickstart source file, colorlog",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Local JSON log rendering, colorlog",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Colored terminal logging, colorlog",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Stdlib Formatter class, colorlog",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Logging pipeline role, colorlog",
      "display": "Color escape-code Formatter classes for existing stdlib handlers; native scope is colored text, not JSON record serialization or a remote log service.",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Original workflow and current API boundary, colorlog",
      "display": "Flipper App.__call__ explicitly constructs colorlog.ColoredFormatter with percent-format log_color and log_colors mapping, supported by selected6.12 README. colorlog.StreamHandler/getLogger are re-exported stdlib functions/classes; setLevel, addHandler, setFormatter, and logger.error are stdlib operations and do not increase Colorlog-native call count. Whole30-line task-named CLI entry point qualifies one-call exception. It parses arguments, configures handler only when no handler exists, and invokes original before/call/after hooks; it is not standalone or an excuse to execute firmware commands.",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Project function, colorlog",
      "display": "def create_default_formatter() -> logging.Formatter:\n    \"\"\"Create a default formatter of log messages.\n\n    This function is not supposed to be directly accessed by library users.\n    \"\"\"\n    header = \"[%(levelname)1.1s %(asctime)s]\"\n    message = \"%(message)s\"\n    return colorlog.TTYColoredFormatter(\n        f\"%(log_color)s{header}%(reset)s {message}\",\n        stream=sys.stderr,\n    )\n",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Project source file, colorlog",
      "display": "optuna/logging.py",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Project full_name, colorlog",
      "display": "optuna/optuna",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Project stargazers_count, colorlog",
      "display": "15.1K",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Library name, coloredlogs",
      "display": "coloredlogs",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Monthly downloads, coloredlogs",
      "display": "40.2M",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "License, coloredlogs",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Package release, coloredlogs",
      "display": "15.0.1",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Package release date, coloredlogs",
      "display": "Jun 2021",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Install, coloredlogs",
      "display": "python3.13 -m pip install coloredlogs==15.0.1",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Quickstart, coloredlogs",
      "display": "import coloredlogs, logging\n\ncoloredlogs.install(level=\"DEBUG\")\nlogger = logging.getLogger(\"some.module.name\")\nlogger.info(\"this is an informational message\")",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Official description, coloredlogs",
      "display": "Colored terminal output for Python's logging module",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Quickstart source file, coloredlogs",
      "display": "api.html",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Local JSON log rendering, coloredlogs",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Colored terminal logging, coloredlogs",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Stdlib Formatter class, coloredlogs",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Logging pipeline role, coloredlogs",
      "display": "Colored stdlib Formatter plus install helper configuring a stream handler, level, and field styles; formatters use ordinary LogRecord fields.",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Original workflow and current API boundary, coloredlogs",
      "display": "ScoutSuite whole35-line set_logger_configuration calls coloredlogs.install with ERROR in quiet mode or DEBUG/INFO otherwise, with an actual stdlib logger. Current15.0.1 API documents level and logger keyword arguments; these two native sites are alternative branches, not two installs per invocation. Optional file output is created by stdlib FileHandler/Formatter plus a host filter, not native Coloredlogs file rotation or JSON output. Global verbose_exceptions flag and file path host behavior are preserved unchanged.",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Project function, coloredlogs",
      "display": "def set_logger_configuration(is_debug=False, quiet=False, output_file_path=None):\n    \"\"\"\n    Configure whether full stacktraces should be dumped in the console output\n    \"\"\"\n\n    # set debug level\n    global verbose_exceptions\n    verbose_exceptions = is_debug\n\n    # if \"quiet\" is set, don't output anything\n    if quiet:\n        coloredlogs.install(level='ERROR', logger=logger)\n    else:\n        coloredlogs.install(level='DEBUG' if is_debug else 'INFO', logger=logger)\n\n    if output_file_path:\n        # For some reason, hostname information is not passed to the FileHandler\n        # Add it using a filter\n        class HostnameFilter(logging.Filter):\n            hostname = platform.node()\n\n            def filter(self, record):\n                record.hostname = HostnameFilter.hostname\n                return True\n\n        # create file handler which logs messages\n        fh = logging.FileHandler(output_file_path, 'w+')\n        # Add filter to add hostname information\n        fh.addFilter(HostnameFilter())\n        # create formatter and add it to the handlers\n        formatter = logging.Formatter(fmt='%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s',\n                                      datefmt='%Y-%m-%d %H:%M:%S')\n        fh.setFormatter(formatter)\n        # add the handlers to the logger\n        logger.addHandler(fh)",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Project source file, coloredlogs",
      "display": "ScoutSuite/core/console.py",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Project full_name, coloredlogs",
      "display": "nccgroup/ScoutSuite",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Project stargazers_count, coloredlogs",
      "display": "7.9K",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Developer need, opentelemetry",
      "display": "Logs in OTLP format",
      "asOf": "2026-11-17"
    },
    "F261": {
      "label": "Pick reason, opentelemetry",
      "display": "writes logging records as OTLP to a network destination or file",
      "asOf": "2026-11-17"
    },
    "F262": {
      "label": "Developer need, sentry",
      "display": "Logs beside Sentry errors",
      "asOf": "2026-11-17"
    },
    "F263": {
      "label": "Pick reason, sentry",
      "display": "sends logs that appear next to related errors",
      "asOf": "2026-11-17"
    },
    "F264": {
      "label": "Developer need, json logger",
      "display": "JSON from existing logging calls",
      "asOf": "2026-11-17"
    },
    "F265": {
      "label": "Pick reason, json logger",
      "display": "adds a JSON formatter to the logging package",
      "asOf": "2026-11-17"
    },
    "F266": {
      "label": "Developer need, colorlog",
      "display": "Colored log levels",
      "asOf": "2026-11-17"
    },
    "F267": {
      "label": "Pick reason, colorlog",
      "display": "colors output from the logging module",
      "asOf": "2026-11-17"
    },
    "F268": {
      "label": "Developer need, coloredlogs",
      "display": "Colored output in one call",
      "asOf": "2026-11-17"
    },
    "F269": {
      "label": "Pick reason, coloredlogs",
      "display": "installs a colored handler on the root logger",
      "asOf": "2026-11-17"
    },
    "F270": {
      "label": "Strength, opentelemetry",
      "display": "Writes OTLP records",
      "asOf": "2026-11-17"
    },
    "F271": {
      "label": "Strength body, opentelemetry",
      "display": "LoggingHandler sends standard logging records to a network destination or a file in OTLP format.",
      "asOf": "2026-11-17"
    },
    "F272": {
      "label": "Strength, sentry",
      "display": "Searchable by attribute",
      "asOf": "2026-11-17"
    },
    "F273": {
      "label": "Strength body, sentry",
      "display": "Logs appear beside related errors and can be searched by text or by individual attributes.",
      "asOf": "2026-11-17"
    },
    "F274": {
      "label": "Limit, sentry",
      "display": "Recent SDK required",
      "asOf": "2026-11-17"
    },
    "F275": {
      "label": "Limit body, sentry",
      "display": "Logs need Sentry Python SDK 2.35.0 or later.",
      "asOf": "2026-11-17"
    },
    "F276": {
      "label": "Strength, json logger",
      "display": "Plugs into existing handlers",
      "asOf": "2026-11-17"
    },
    "F277": {
      "label": "Strength body, json logger",
      "display": "The formatter attaches to a standard logging handler, and existing log calls stay unchanged.",
      "asOf": "2026-11-17"
    },
    "F278": {
      "label": "Strength, colorlog",
      "display": "Extends logging.Formatter",
      "asOf": "2026-11-17"
    },
    "F279": {
      "label": "Strength body, colorlog",
      "display": "ColoredFormatter replaces the formatter on any standard logging handler.",
      "asOf": "2026-11-17"
    },
    "F280": {
      "label": "Limit, colorlog",
      "display": "Color off outside terminals",
      "asOf": "2026-11-17"
    },
    "F281": {
      "label": "Limit body, colorlog",
      "display": "Colors turn off on output that is not a terminal unless force_color is set.",
      "asOf": "2026-11-17"
    },
    "F282": {
      "label": "Strength, coloredlogs",
      "display": "One-call setup",
      "asOf": "2026-11-17"
    },
    "F283": {
      "label": "Strength body, coloredlogs",
      "display": "coloredlogs.install adds a colored handler to the root logger, which also colors messages from other libraries.",
      "asOf": "2026-11-17"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python logging libraries logging Loguru structlog RichHandler code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
