Auto Docs¶
fprl: A library for implementing logs per flask request.
-
fprl.build_logger()¶ Construct a logger instance.
This callback is used to build the logger that
fprl.inject_logger()attaches to the request proxy.This can be overridden to change the behavior of the library to utilize other logging libraries.
This function will be called when the flask request context and the flask application context are active, and it will be called before every request.
Return type: logging.Logger
-
fprl.inject_logger()¶ Injects a logger into each request instance.
Register this as an app pre_request hook, ideally as the first hook so the logger can be utilized by later pre_request hooks.
Utilizes the
fprl.build_logger()callback in order to build a logger instance, and attaches it to the active request as flask.request.logger