forked from github/pelican
Merge pull request #2763 from kernc/root-logger
Force root logger to be of FatalLogger class
This commit is contained in:
commit
4d70447a5a
3 changed files with 9 additions and 3 deletions
|
|
@ -76,10 +76,14 @@ section.
|
|||
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::
|
||||
|
||||
import logging
|
||||
|
||||
from pelican import signals
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def test(sender):
|
||||
print("{} initialized !!".format(sender))
|
||||
log.debug("%s initialized !!", sender)
|
||||
|
||||
def register():
|
||||
signals.initialized.connect(test)
|
||||
|
|
|
|||
|
|
@ -742,8 +742,8 @@ Time and Date
|
|||
|
||||
.. parsed-literal::
|
||||
|
||||
LOCALE = ('usa', 'jpn', # On Windows
|
||||
'en_US', 'ja_JP' # On Unix/Linux
|
||||
LOCALE = ('usa', 'jpn', # On Windows
|
||||
'en_US', 'ja_JP' # On Unix/Linux
|
||||
)
|
||||
|
||||
For a list of available locales refer to `locales on Windows`_ or on
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ class FatalLogger(LimitLogger):
|
|||
|
||||
|
||||
logging.setLoggerClass(FatalLogger)
|
||||
# force root logger to be of our preferred class
|
||||
logging.getLogger().__class__ = FatalLogger
|
||||
|
||||
|
||||
def supports_color():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue