forked from getpelican/pelican
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent logging interception; add log tests
Prevents FatalLogger from re-logging warning & error level log records, which had resulted in masking the initial source of the log messages. Change to Interface =================== This change modifies the FatalLogger class attributes: - warnings_fatal - errors_fatal + fatal_log_level Motivation ---------- Intention is to clarify the behavior: raise RuntimeErrors on any desired log-level *or higher*. The previous implementation did not respond to higher log levels (eg. logging.CRITICAL) and allowed unintuitive states: for example, it was possible to set the logger to fail at warning level yet not error-level. Fix getpelican#3037
- Loading branch information
1 parent
062144a
commit abdedb2
Showing
3 changed files
with
98 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Release type: minor | ||
|
||
Rework `pelican.log.FatalLogger` to prevent overriding the source of `warning` | ||
and `error` level logs. | ||
|
||
Changes the class attributes on `FatalLogger`: | ||
``` | ||
- warnings_fatal | ||
- errors_fatal | ||
+ fatal_log_level | ||
``` | ||
This allows logic to merely check whether the log record is at (or higher than) | ||
whichever level is declared "fatal". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters