datawire / mdk

Microservices Development Kit. Open source SDK for building microservices in multiple languages.
https://www.datawire.io
Apache License 2.0
58 stars 6 forks source link

Flask logging integration #161

Closed itamarst closed 8 years ago

itamarst commented 8 years ago

Provide a logging.Handler that uses the MDK session from the Flask request, or a default session if logging happens outside of the context of a request.

The Logger name is used as the category, e.g. if I do:

logger = Logger("hello")
logger.addHandler(MDKLoggingHandler(mdk))
logger.info("bar")

this is equivalent to:

mdk_session.info("hello", "bar")