{"repo":"goduni/unilogging","free":true,"listed":false,"github":"https://github.com/goduni/unilogging","clone":"git clone https://github.com/goduni/unilogging.git","description":"A simple library for working with the context of logs.","language":"Python","stars":15,"topics":["context","logging","python","python-logging","structured-logging"],"license":"MIT","category":"analytics","readme_excerpt":"unilogging A simple library for working with the context of logs. Quickstart What Problem Does It Solve? Many modern Python applications use Dependency Injection (DI), but logging has traditionally relied on using a global logger (e.g., logging.getLogger( name ) ). While this simplifies the use of logging, it also introduces a number of complications. If you're developing a web application, there are situations where you need to understand what happened during a specific request (for example, when an error occurs during that request). To do this, it's common to introduce a concept like request id —a unique identifier assigned to an HTTP request, which allows you to trace all logs related to that request. This creates a problem: you now need a way to propagate the request id throughout your application – especially if your application has multiple architectural layers (e.g., infrastructure, service, presentation). Passing request id (and other context data like user id ) explicitly everywhere is problematic, as it leads to a lot of boilerplate and argument duplication in your code, all just to enable proper logging. How does Unilogging solve this? Unilogging helps structure the logging process using Dependency Injection (DI). For each request to your web application, a separate context is created. You can populate this context with data regardless of the application layer – using DI is all you need. For example, consider this scenario: You generate a request id in a FastAPI mi","default_branch":null,"files":null,"tree":[],"storefront":"/r/goduni","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/goduni/unilogging/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}