Skip to content

Commit

Permalink
add logger handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHAO Yijun committed Sep 3, 2018
1 parent 53d1807 commit bf4ee5d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pymesos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import sys
import logging

from .interface import Scheduler, Executor, OperatorMaster
from .scheduler import MesosSchedulerDriver
from .executor import MesosExecutorDriver
from .operator_v1 import MesosOperatorMasterDriver, MesosOperatorAgentDriver
from .utils import encode_data, decode_data
import logging


fmt = '%(asctime)-15s [%(levelname)s] [%(threadName)s] [%(name)-9s:%(lineno)d] %(message)s'
logging.basicConfig(format=fmt, level=logging.INFO)
LOG_FMT = '%(asctime)-15s [%(levelname)s] [%(threadName)s]' \
' [%(name)-9s:%(lineno)d] %(message)s'
DATE_FMT = '%Y-%m-%d %H:%M:%S'

logger = logging.getLogger('pymesos')
handler = logging.StreamHandler(stream=sys.stderr)
handler.setFormatter(logging.Formatter(LOG_FMT, DATE_FMT))
logger.addHandler(handler)
logger.setLevel(logging.INFO)


__VERSION__ = '0.3.8'
__VERSION__ = '0.3.9'

__all__ = (
'Scheduler',
Expand Down

0 comments on commit bf4ee5d

Please sign in to comment.