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 project currently defines [`logging`](https://docs.python.org/3/library/logging.html) levels as follows:
92
-
***TRACE:** Use this for tracing every step of a complex process. That way we can see which step of the process failed. Err on the side of verbose. **Note:** This is a PyDis-implemented logging level.
93
-
***DEBUG:** Someone is interacting with the application, and the application is behaving as expected.
94
-
***INFO:** Something completely ordinary happened. Like a cog loading during startup.
95
-
***WARNING:** Someone is interacting with the application in an unexpected way or the application is responding in an unexpected way, but without causing an error.
96
-
***ERROR:** An error that affects the specific part that is being interacted with
97
-
***CRITICAL:** An error that affects the whole application.
91
+
The project currently defines [`logging`](https://docs.python.org/3/library/logging.html) levels as follows, from lowest to highest severity:
92
+
***TRACE:** These events should be used to provide a *verbose* trace of every step of a complex process. This is essentially the `logging` equivalent of sprinkling `print` statements throughout the code.
93
+
***Note:** This is a PyDis-implemented logging level.
94
+
***DEBUG:** These events should add context to what's happening in a development setup to make it easier to follow what's going while working on a project. This is in the same vein as **TRACE** logging but at a much lower level of verbosity.
95
+
***INFO:** These events are normal and don't need direct attention but are worth keeping track of in production, like checking which cogs were loaded during a start-up.
96
+
***WARNING:** These events are out of the ordinary and should be fixed, but have not caused a failure.
97
+
***NOTE:** Events at this logging level and higher should be reserved for events that require the attention of the DevOps team.
98
+
***ERROR:** These events have caused a failure in a specific part of the application and require urgent attention.
99
+
***CRITICAL:** These events have caused the whole application to fail and require immediate intervention.
98
100
99
101
Ensure that log messages are succinct. Should you want to pass additional useful information that would otherwise make the log message overly verbose the `logging` module accepts an `extra` kwarg, which can be used to pass a dictionary. This is used to populate the `__dict__` of the `LogRecord` created for the logging event with user-defined attributes that can be accessed by a log handler. Additional information and caveats may be found [in Python's `logging` documentation](https://docs.python.org/3/library/logging.html#logging.Logger.debug).
0 commit comments