2013-03-27 18:17:11 -04:00
|
|
|
import logging
|
2015-10-19 22:38:23 +02:00
|
|
|
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
|
2013-03-27 18:17:11 -04:00
|
|
|
logging.getLogger().addHandler(logging.NullHandler())
|