### Install for Testing Source: https://async-worker.github.io/aiologger/index.html Install development dependencies and run tests using pipenv. ```bash pipenv install --dev pipenv run test ``` -------------------------------- ### Install development dependencies and run tests Source: https://async-worker.github.io/aiologger/_sources/index.rst.txt Use pipenv to set up the development environment and execute the test suite. ```bash pipenv install --dev pipenv run test ``` -------------------------------- ### Configure JSON Output Formatting Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Example of the resulting JSON structure when configured for pretty printing. ```javascript { "logged_at": "2017-08-11T21:04:21.559070", "line_number": 5, "function": "", "level": "INFO", "file_path": "/Users/diogo/Library/Preferences/PyCharm2017.1/scratches/scratch_32.py", "msg": { "artist": "Black Country Communion", "song": "Cold" } } ``` -------------------------------- ### Install aiologger Source: https://async-worker.github.io/aiologger/index.html Install the aiologger package using pip. ```bash pip install aiologger ``` -------------------------------- ### Install aiologger via pip Source: https://async-worker.github.io/aiologger/_sources/index.rst.txt Use this command to install the package in your Python environment. ```bash pip install aiologger ``` -------------------------------- ### Initialize AsyncFileHandler Source: https://async-worker.github.io/aiologger/_sources/handlers_files.rst.txt Instantiate AsyncFileHandler for asynchronous file logging. Ensure aiologger is installed with the 'aiofiles' extra. The file is opened lazily on the first emit call. ```python from aiologger.handlers.files import AsyncFileHandler from tempfile import NamedTemporaryFile temp_file = NamedTemporaryFile() handler = AsyncFileHandler(filename=temp_file.name) ``` -------------------------------- ### Asynchronous Logging with aiologger Source: https://async-worker.github.io/aiologger/usage.html Generate logs asynchronously by replacing the standard logger with `aiologger.Logger`. This example uses `Logger.with_default_handlers()` for convenience. Note that the output order is not guaranteed when using this method. ```python import asyncio from aiologger import Logger async def main(): logger = Logger.with_default_handlers(name='my-logger') logger.debug("debug") logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical") await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.run_forever() ``` ```text warning debug info error critical ``` -------------------------------- ### Adding Extra Fields to JSON Logs Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Illustrates how to add custom fields to JSON log messages using the 'extra' parameter. This example logs a simple message and then logs a dictionary with additional context derived from local variables. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): a = 69 b = 666 c = [a, b] logger = JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "2017-08-11T12:21:05.722216", "line_number": 5, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info({"dog": "Xablau"}, extra=locals()) # {"logged_at": "2018-06-14T09:47:29.477705", "line_number": 14, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": {"dog": "Xablau"}, "logger": "", "c": [69, 666], "b": 666, "a": 69} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Overriding Default Root Content in JSON Logs Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Shows how to override default fields in JSON logs by providing custom values in the 'extra' parameter. This example demonstrates overriding the 'logged_at' field. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "2017-08-11T12:21:05.722216", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info("I'm a simple log", extra={'logged_at': 'Yesterday'}) # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### AsyncFileHandler Initialization Source: https://async-worker.github.io/aiologger/handlers_files.html Demonstrates how to initialize and use the AsyncFileHandler. It requires the 'aiofiles' extra dependency. The handler delays file opening until the first log emission. ```APIDOC ## AsyncFileHandler ### Description A handler class that sends logs into files. The specified file is opened and used as the _stream_ for logging. If `mode` is not specified, ‘a’ is used. If `encoding` is not `None`, it is used to open the file with that encoding. The file opening is delayed until the first call to `emit()`. **Important**: AsyncFileHandler depends on an optional dependency and you should install aiologger with `pip install aiologger[aiofiles]` ### Usage Example ```python from aiologger.handlers.files import AsyncFileHandler from tempfile import NamedTemporaryFile temp_file = NamedTemporaryFile() handler = AsyncFileHandler(filename=temp_file.name) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Configure aiologger instance Source: https://async-worker.github.io/aiologger/_sources/usage.rst.txt Demonstrates how to swap the standard logger for an aiologger instance. ```python from logging import getLogger logger = getLogger(__name__) ``` ```python from aiologger import Logger logger = Logger.with_default_handlers() ``` -------------------------------- ### AsyncStreamHandler Initialization Source: https://async-worker.github.io/aiologger/handlers_streams.html Documentation for initializing the AsyncStreamHandler class. ```APIDOC ## AsyncStreamHandler Initialization ### Description A handler class for writing logs into a stream which may be sys.stdout or sys.stderr. If a stream isn’t provided, it defaults to sys.stderr. ### Parameters - **stream** (object) - Optional - The stream to write logs to (e.g., sys.stdout, sys.stderr). Defaults to sys.stderr. - **level** (int) - Optional - The logging level. Defaults to logging.NOTSET. - **formatter** (object) - Optional - The formatter used to format the log record before emit() is called. - **filter** (object) - Optional - A filter used to filter log records. ### Request Example ```python import sys from aiologger.handlers.streams import AsyncStreamHandler handler = AsyncStreamHandler(stream=sys.stdout) ``` ``` -------------------------------- ### Basic JSON Logging with Default Handlers Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Demonstrates basic JSON logging using JsonLogger with default handlers. It shows how to log a dictionary with flatten=True, which includes metadata like line number and function name. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info({'logged_at': 'Yesterday'}, flatten=True) # {"logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Initialize AsyncStreamHandler Source: https://async-worker.github.io/aiologger/_sources/handlers_streams.rst.txt Instantiate an AsyncStreamHandler to write logs to a specified stream. ```python import sys from aiologger.handlers.streams import AsyncStreamHandler handler = AsyncStreamHandler(stream=sys.stdout) ``` -------------------------------- ### Log strings and objects with JsonLogger Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Demonstrates basic usage of JsonLogger to output strings and dictionaries as JSON, including automatic serialization of datetime and exception objects. ```python import asyncio from datetime import datetime from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers() await logger.info("Im a string") # {"logged_at": "2018-06-14T09:34:56.482817", "line_number": 9, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": "Im a string"} await logger.info({ 'date_objects': datetime.now(), 'exceptions': KeyError("Boooom"), 'types': JsonLogger }) # {"logged_at": "2018-06-14T09:34:56.483000", "line_number": 13, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": {"date_objects": "2018-06-14T09:34:56.482953", "exceptions": "Exception: KeyError('Boooom',)", "types": ""}} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Standard Logging with aiologger Source: https://async-worker.github.io/aiologger/usage.html Use aiologger as a drop-in replacement for the standard logging library without changing your codebase to async/await. Ensure you import `getLogger` from `logging`. ```python import asyncio import logging from logging import getLogger async def main(): logger = getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format="%(message)s") logger.debug("debug") logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical") loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.run_forever() ``` ```text debug info warning error critical ``` -------------------------------- ### Async/Await Logging with aiologger Source: https://async-worker.github.io/aiologger/usage.html Utilize the `async/await` syntax for logging with `aiologger`. This method guarantees order within distinct handlers (stdout/stderr) but not between them. `Logger.with_default_handlers()` sets up handlers for stdout (info/debug) and stderr (warning/error/critical). ```python import asyncio from aiologger import Logger async def main(): logger = Logger.with_default_handlers(name='my-logger') await logger.debug("debug at stdout") await logger.info("info at stdout") await logger.warning("warning at stderr") await logger.error("error at stderr") await logger.critical("critical at stderr") await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` ```text warning at stderr debug at stdout error at stderr info at stdout critical at stderr ``` -------------------------------- ### Configuring JSON Serializer with Indentation Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Demonstrates how to configure the JSON serializer for pretty printing by passing 'indent' as a keyword argument to 'serializer_kwargs'. This makes the JSON output more human-readable. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers( level=logging.DEBUG, serializer_kwargs={'indent': 4} ) await logger.info({ ``` -------------------------------- ### Perform asynchronous logging with await Source: https://async-worker.github.io/aiologger/_sources/usage.rst.txt Uses explicit await syntax to ensure log ordering when using aiologger. ```python import asyncio from aiologger import Logger async def main(): logger = Logger.with_default_handlers(name='my-logger') await logger.debug("debug at stdout") await logger.info("info at stdout") await logger.warning("warning at stderr") await logger.error("error at stderr") await logger.critical("critical at stderr") await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Configuring JSON serializer options Source: https://async-worker.github.io/aiologger/loggers_jsonlogger.html Pass keyword arguments to the underlying JSON serializer using serializer_kwargs to control output formatting like indentation. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers( level=logging.DEBUG, serializer_kwargs={'indent': 4} ) await logger.info({ "artist": "Black Country Communion", "song": "Cold" }) await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` ```json { "logged_at": "2017-08-11T21:04:21.559070", "line_number": 5, "function": "", "level": "INFO", "file_path": "/Users/diogo/Library/Preferences/PyCharm2017.1/scratches/scratch_32.py", "msg": { "artist": "Black Country Communion", "song": "Cold" } } ``` ```python await logger.warning({'artist': 'Black Country Communion', 'song': 'Cold'}, serializer_kwargs={'indent': 4}) ``` -------------------------------- ### Flatten log content to root level Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Demonstrates how to move dictionary keys to the root level of the JSON output using the flatten parameter, either globally or per-call. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG, flatten=True) await logger.info({"status_code": 200, "response_time": 0.00534534}) # {"status_code": 200, "response_time": 0.534534, "logged_at": "2017-08-11T16:18:58.446985", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.error({"status_code": 404, "response_time": 0.00134534}) # {"status_code": 200, "response_time": 0.534534, "logged_at": "2017-08-11T16:18:58.446986", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = await JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info({"status_code": 200, "response_time": 0.00534534}, flatten=True) # {"logged_at": "2017-08-11T16:23:16.312441", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py", "status_code": 200, "response_time": 0.00534534} await logger.error({"status_code": 404, "response_time": 0.00134534}) # {"logged_at": "2017-08-11T16:23:16.312618", "line_number": 8, "function": "", "level": "ERROR", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py", "msg": {"status_code": 404, "response_time": 0.00134534}} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### JsonLogger API Overview Source: https://async-worker.github.io/aiologger/_sources/loggers.rst.txt Overview of the JsonLogger class for structured JSON logging. ```APIDOC ## JsonLogger ### Description A specialized logger class designed to output log records in JSON format for structured logging. ``` -------------------------------- ### Logger API Overview Source: https://async-worker.github.io/aiologger/_sources/loggers.rst.txt Overview of the primary Logger class used for asynchronous logging. ```APIDOC ## Logger ### Description The primary class for handling asynchronous logging operations within the aiologger library. ``` -------------------------------- ### Setting Default Extra Fields for JSON Logger Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Demonstrates how to set default extra fields for a JsonLogger instance during initialization. These fields will be included in all log messages from this logger instance. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG, extra={'logged_at': 'Yesterday'}) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Use aiologger with standard logging syntax Source: https://async-worker.github.io/aiologger/_sources/usage.rst.txt Replaces the standard library logger with aiologger.Logger to perform logging operations without explicit await calls. ```python import asyncio import logging from logging import getLogger async def main(): logger = getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format="%(message)s") logger.debug("debug") logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical") loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.run_forever() ``` -------------------------------- ### Perform asynchronous logging without await Source: https://async-worker.github.io/aiologger/_sources/usage.rst.txt Logs messages asynchronously using the default handlers without requiring await syntax for each call. ```python import asyncio from aiologger import Logger async def main(): logger = Logger.with_default_handlers(name='my-logger') logger.debug("debug") logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical") await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.run_forever() ``` -------------------------------- ### Log dynamic content with CallableWrapper Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Uses CallableWrapper to evaluate callables at serialization time, allowing for dynamic log values. ```python import asyncio import logging from random import randint from aiologger.loggers.json import JsonLogger from aiologger.utils import CallableWrapper def rand(): return randint(1, 100) logger = JsonLogger.with_default_handlers(level=logging.DEBUG) async def main(): await logger.info(CallableWrapper(rand)) # {"logged_at": "2018-06-14T09:37:52.624123", "line_number": 15, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": 70} await logger.info({"Xablau": CallableWrapper(rand)}) # {"logged_at": "2018-06-14T09:37:52.624305", "line_number": 18, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": {"Xablau": 29}} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Flattening as Method Parameter Source: https://async-worker.github.io/aiologger/loggers_jsonlogger.html Using 'flatten=True' as a parameter in a specific log method call only flattens the attributes for that particular log entry. This provides more granular control over flattening. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = await JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info({"status_code": 200, "response_time": 0.00534534}, flatten=True) # {"logged_at": "2017-08-11T16:23:16.312441", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py", "status_code": 200, "response_time": 0.00534534} await logger.error({"status_code": 404, "response_time": 0.00134534}) # {"logged_at": "2017-08-11T16:23:16.312618", "line_number": 8, "function": "", "level": "ERROR", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py", "msg": {"status_code": 404, "response_time": 0.00134534}} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Excluding Default Fields from JSON Logs Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Shows how to exclude specific default fields (like function name, file path, line number) from JSON log output using the 'exclude_fields' parameter. This is useful for reducing log verbosity. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger from aiologger.formatters.json import FUNCTION_NAME_FIELDNAME, LOGGED_AT_FIELDNAME async def main(): logger = JsonLogger.with_default_handlers( level=logging.DEBUG, exclude_fields=[FUNCTION_NAME_FIELDNAME, LOGGED_AT_FIELDNAME, 'file_path', 'line_number'] ) await logger.info("Function, file path and line number wont be printed") # {"level": "INFO", "msg": "Function, file path and line number wont be printed"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Apply serializer_kwargs to Log Calls Source: https://async-worker.github.io/aiologger/_sources/loggers_jsonlogger.rst.txt Pass indent parameters directly to the log call to control JSON serialization formatting. ```python await logger.warning({'artist': 'Black Country Communion', 'song': 'Cold'}, serializer_kwargs={'indent': 4}) ``` -------------------------------- ### Injecting extra fields into JSON logs Source: https://async-worker.github.io/aiologger/loggers_jsonlogger.html Use the extra parameter to add custom fields to the root of the JSON log output. This can be passed as a dictionary to the log method or defined during logger initialization. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): a = 69 b = 666 c = [a, b] logger = JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "2017-08-11T12:21:05.722216", "line_number": 5, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info({"dog": "Xablau"}, extra=locals()) # {"logged_at": "2018-06-14T09:47:29.477705", "line_number": 14, "function": "main", "level": "INFO", "file_path": "/Users/diogo.mmartins/Library/Preferences/PyCharm2018.1/scratches/scratch_47.py", "msg": {"dog": "Xablau"}, "logger": "", "c": [69, 666], "b": 666, "a": 69} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "2017-08-11T12:21:05.722216", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info("I'm a simple log", extra={'logged_at': 'Yesterday'}) # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG, extra={'logged_at': 'Yesterday'}) await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.info("I'm a simple log") # {"msg": "I'm a simple log", "logged_at": "Yesterday", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` -------------------------------- ### Flattening as Instance Attribute Source: https://async-worker.github.io/aiologger/loggers_jsonlogger.html When 'flatten' is set as an instance attribute on JsonLogger, all subsequent log calls will merge dictionary attributes into the root JSON object. This is useful for consistently flattening all log messages. ```python import asyncio import logging from aiologger.loggers.json import JsonLogger async def main(): logger = JsonLogger.with_default_handlers(level=logging.DEBUG, flatten=True) await logger.info({"status_code": 200, "response_time": 0.00534534}) # {"status_code": 200, "response_time": 0.534534, "logged_at": "2017-08-11T16:18:58.446985", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.error({"status_code": 404, "response_time": 0.00134534}) # {"status_code": 200, "response_time": 0.534534, "logged_at": "2017-08-11T16:18:58.446986", "line_number": 6, "function": "", "level": "INFO", "path": "/Users/diogo/PycharmProjects/aiologger/bla.py"} await logger.shutdown() loop = asyncio.get_event_loop() loop.run_until_complete(main()) loop.close() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.