improving log messages

This commit is contained in:
Janne Sinivirta
2018-02-24 18:33:08 +02:00
parent 5e73f3431c
commit 160af91f9a
5 changed files with 19 additions and 22 deletions

View File

@@ -65,10 +65,7 @@ def process_maybe_execute_buy(interval: int) -> bool:
if create_trade(float(_CONF['stake_amount']), interval):
return True
logger.info(
'Checked all whitelisted currencies. '
'Found no suitable entry positions for buying. Will keep looking ...'
)
logger.info('Found no buy signals for whitelisted currencies. Trying again..')
return False
except DependencyException as exception:
logger.warning('Unable to create trade: %s', exception)
@@ -83,7 +80,7 @@ def process_maybe_execute_sell(trade: Trade, interval: int) -> bool:
# Get order details for actual price per unit
if trade.open_order_id:
# Update trade with order values
logger.info('Got open order for %s', trade)
logger.info('Found open order for %s', trade)
trade.update(exchange.get_order(trade.open_order_id))
if trade.is_open and trade.open_order_id is None:
@@ -130,16 +127,16 @@ def _process(interval: int, nb_assets: Optional[int] = 0) -> bool:
except (requests.exceptions.RequestException, json.JSONDecodeError) as error:
logger.warning(
'Got %s in _process(), retrying in 30 seconds...',
'%s in _process(), retrying in 30 seconds...',
error
)
time.sleep(30)
except OperationalException:
rpc.send_msg('*Status:* Got OperationalException:\n```\n{traceback}```{hint}'.format(
rpc.send_msg('*Status:* OperationalException:\n```\n{traceback}```{hint}'.format(
traceback=traceback.format_exc(),
hint='Issue `/start` if you think it is safe to restart.'
))
logger.exception('Got OperationalException. Stopping trader ...')
logger.exception('OperationalException. Stopping trader ...')
update_state(State.STOPPED)
return state_changed
@@ -558,9 +555,9 @@ def main(sysargv=sys.argv[1:]) -> int:
)
old_state = new_state
except KeyboardInterrupt:
logger.info('Got SIGINT, aborting ...')
logger.info('SIGINT received, aborting ...')
except BaseException:
logger.exception('Got fatal exception!')
logger.exception('Fatal exception!')
finally:
cleanup()
return 0