mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-02 12:10:23 +08:00
BUG: check that self.logger exists
`self.logger` is initialized as `None` and there is no guarantee that users have set it, so check that it exists before trying to pass messages to it.
This commit is contained in:
1 parent
51c8a310be
commit
d00edbcf04
1 file changed
+2
-1
@@ -471,7 +471,8 @@ class TradingAlgorithm(object):
|
||||
zero_message = "Price of 0 for {psid}; can't infer value".format(
|
||||
psid=sid
|
||||
)
|
||||
self.logger.debug(zero_message)
|
||||
if self.logger:
|
||||
self.logger.debug(zero_message)
|
||||
# Don't place any order
|
||||
return
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user