You can use aiologger as a drop-in replacement for the standard logging library if you want to keep your existing synchronous syntax. Behind the scenes, logs will still be generated asynchronously.
To migrate, replace your standard logger initialization with aiologger.Logger.
Standard Library approach:
from logging import getLogger
logger = getLogger(__name__)
logger.info("message")
aiologger (Synchronous-style) approach:
from aiologger import Logger
logger = Logger.with_default_handlers()
logger.info("message")
Note: When using the synchronous-style calls without await, the output order is not guaranteed.
from aiologger import Logger
logger = Logger.with_default_handlers()
logger.info("info")