move logging to freqtrade.rpc

This commit is contained in:
gcarq
2017-11-18 21:43:21 +01:00
parent 3ab14dfe39
commit d41837817c
2 changed files with 12 additions and 8 deletions

View File

@@ -1,5 +1,10 @@
import logging
from . import telegram
logger = logging.getLogger(__name__)
REGISTERED_MODULES = []
@@ -11,6 +16,7 @@ def init(config: dict) -> None:
"""
if config['telegram'].get('enabled', False):
logger.info('Enabling rpc.telegram ...')
REGISTERED_MODULES.append('telegram')
telegram.init(config)
@@ -21,6 +27,7 @@ def cleanup() -> None:
:return: None
"""
if 'telegram' in REGISTERED_MODULES:
logger.debug('Cleaning up rpc.telegram ...')
telegram.cleanup()
@@ -30,5 +37,6 @@ def send_msg(msg: str) -> None:
:param msg: message
:return: None
"""
logger.info(msg)
if 'telegram' in REGISTERED_MODULES:
telegram.send_msg(msg)