Allow setting other handlers in the logging

This commit is contained in:
Ben Letham 2018-12-03 16:29:07 -08:00
parent b76ace9570
commit f44285038c
3 changed files with 6 additions and 5 deletions

View file

@ -17,7 +17,7 @@ import logging
import numpy as np
import pandas as pd
logger = logging.getLogger(__name__)
logger = logging.getLogger('fbprophet')
def generate_cutoffs(df, horizon, initial, period):

View file

@ -31,8 +31,10 @@ from fbprophet.plot import (
plot_seasonality,
)
logging.basicConfig()
logger = logging.getLogger(__name__)
logger = logging.getLogger('fbprophet')
logger.addHandler(logging.NullHandler())
if len(logger.handlers) == 1:
logging.basicConfig(level=logging.INFO)
class Prophet(object):

View file

@ -17,9 +17,8 @@ import pandas as pd
from fbprophet.diagnostics import performance_metrics
logger = logging.getLogger('fbprophet')
logging.basicConfig()
logger = logging.getLogger(__name__)
try:
from matplotlib import pyplot as plt