Merge pull request #2763 from kernc/root-logger

Force root logger to be of FatalLogger class
This commit is contained in:
Justin Mayer 2020-06-07 06:58:22 +02:00 committed by GitHub
commit 4d70447a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -76,10 +76,14 @@ section.
The only rule to follow for plugins is to define a ``register`` callable, in The only rule to follow for plugins is to define a ``register`` callable, in
which you map the signals to your plugin logic. Let's take a simple example:: which you map the signals to your plugin logic. Let's take a simple example::
import logging
from pelican import signals from pelican import signals
log = logging.getLogger(__name__)
def test(sender): def test(sender):
print("{} initialized !!".format(sender)) log.debug("%s initialized !!", sender)
def register(): def register():
signals.initialized.connect(test) signals.initialized.connect(test)

View file

@ -742,8 +742,8 @@ Time and Date
.. parsed-literal:: .. parsed-literal::
LOCALE = ('usa', 'jpn', # On Windows LOCALE = ('usa', 'jpn', # On Windows
'en_US', 'ja_JP' # On Unix/Linux 'en_US', 'ja_JP' # On Unix/Linux
) )
For a list of available locales refer to `locales on Windows`_ or on For a list of available locales refer to `locales on Windows`_ or on

View file

@ -165,6 +165,8 @@ class FatalLogger(LimitLogger):
logging.setLoggerClass(FatalLogger) logging.setLoggerClass(FatalLogger)
# force root logger to be of our preferred class
logging.getLogger().__class__ = FatalLogger
def supports_color(): def supports_color():