Varia's website
https://varia.zone
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
463 B
16 lines
463 B
2 weeks ago
|
import logging
|
||
|
import warnings
|
||
|
|
||
|
from pelican.log import log_warnings
|
||
|
|
||
|
# redirect warnings modulole to use logging instead
|
||
|
log_warnings()
|
||
|
|
||
|
# setup warnings to log DeprecationWarning's and error on
|
||
|
# warnings in pelican's codebase
|
||
|
warnings.simplefilter("default", DeprecationWarning)
|
||
|
warnings.filterwarnings("error", ".*", Warning, "pelican")
|
||
|
|
||
|
# Add a NullHandler to silence warning about no available handlers
|
||
|
logging.getLogger().addHandler(logging.NullHandler())
|