Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notes about numeric log levels for TRACE and VERBOSE #659

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stack/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ The guideline of using the log levels is as follows:
In addition there are two additional log levels allowed for specialist pipelines-specific loggers (such as those used for :lclass:`lsst.pipe.base.Task`):

- VERBOSE: for messages of a more detailed nature than would normally be expected to be shown by default but that will not swamp the user in the way that DEBUG messages would if that level of output was enabled.
The `numeric log level`_ for VERBOSE logs is 15.

- TRACE: for detailed information when debugging, particularly inside loops.
The TRACE `numeric log level`_ spans a range from 1-5 (e.g. for use with the ``log-cli-level`` argument to ``pytest``).

An alternative approach for TRACE and VERBOSE is to consider using DEBUG messages with a separate logger name that can be enabled when desired, :ref:`as described below <logger-trace-verbosity>`.
Remember though that the default output level for general users is usually INFO and for large-scale pipeline processing it is VERBOSE.
Expand All @@ -154,6 +157,8 @@ The idea here is that the author understands the intent of the log message and c
A person debugging the code would typically be looking at it and so would be able to determine the appropriate name to enable.
The hierarchy allows all components to be easily enabled or disabled together.

.. _`numeric log level`: <https://docs.python.org/3/library/logging.html#levels>

Logging within the Task framework
=================================

Expand Down
Loading