Move set_loggers to main()

This commit is contained in:
Matthias 2019-05-25 14:51:50 +02:00
parent 6451feee0e
commit 7406edfd8f
2 changed files with 17 additions and 2 deletions

View File

@ -11,5 +11,4 @@ import sys
from freqtrade import main
if __name__ == '__main__':
main.set_loggers()
main.main(sys.argv[1:])

View File

@ -28,7 +28,24 @@ def main(sysargv: List[str]) -> None:
This function will initiate the bot and start the trading loop.
:return: None
"""
set_loggers()
arguments = Arguments(
sysargv,
'Free, open source crypto trading bot'
)
args: Namespace = arguments.get_parsed_arg()
# 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
worker = None
return_code = 1
try:
set_loggers()
worker = None
return_code = 1
@ -64,5 +81,4 @@ def main(sysargv: List[str]) -> None:
if __name__ == '__main__':
set_loggers()
main(sys.argv[1:])