use native python logger

This commit is contained in:
gcarq
2018-03-25 21:37:14 +02:00
parent 3f8d7dae39
commit fa7f74b4bc
14 changed files with 142 additions and 152 deletions

View File

@@ -8,11 +8,11 @@ import logging
import sys
from typing import List
from freqtrade import (__version__)
from freqtrade.arguments import Arguments
from freqtrade.configuration import Configuration
from freqtrade.freqtradebot import FreqtradeBot
from freqtrade.logger import Logger
logger = logging.getLogger('freqtrade')
def main(sysargv: List[str]) -> None:
@@ -26,28 +26,20 @@ def main(sysargv: List[str]) -> None:
)
args = arguments.get_parsed_arg()
logger = Logger(__name__, level=args.loglevel).get_logger()
# A subcommand has been issued.
# Means if Backtesting or Hyperopt have been called we exit the bot
if hasattr(args, 'func'):
args.func(args)
return
logger.info(
'Starting freqtrade %s (loglevel=%s)',
__version__,
logging.getLevelName(args.loglevel)
)
freqtrade = None
return_code = 1
try:
# Load and validate configuration
configuration = Configuration(args)
config = Configuration(args).get_config()
# Init the bot
freqtrade = FreqtradeBot(configuration.get_config())
freqtrade = FreqtradeBot(config)
state = None
while 1: