You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatter support appears to not support messages and likely other attributes. Here is it not supporting the default formatter and using Python 3.9.5.
importasyncioimportloggingimportaiologgerasyncdeftestaiolog():
# The default formatter is '%(message)s'f=logging.Formatter()
logger=aiologger.Logger.with_default_handlers(name="my-logger", formatter=f)
awaitlogger.info("foo")
asyncio.run(testaiolog())
Result is to stderr:
{"record": {"line_number": 10, "level": "INFO", "file_path": "aiologgertest.py", "function": "testaiolog", "msg": "foo"}, "logged_at": "2021-07-14T14:12:28.313405", "logger_exception": {"type": "<class 'AttributeError'>", "exc": "'LogRecord' object has no attribute 'getMessage'", "traceback": ["File \"/Users/mike/.pyenv/versions/global-3.9.5/lib/python3.9/site-packages/aiologger/handlers/streams.py\", line 80, in emit", " msg = self.formatter.format(record) + self.terminator", " File \"/Users/mike/.pyenv/versions/3.9.5/lib/python3.9/logging/__init__.py\", line 663, in format", " record.message = record.getMessage()"]}}
The text was updated successfully, but these errors were encountered:
The formatter support appears to not support messages and likely other attributes. Here is it not supporting the default formatter and using Python 3.9.5.
Result is to stderr:
The text was updated successfully, but these errors were encountered: