self.log_message#

lumibot.strategies.strategy.Strategy.log_message(self, message, color=None, broadcast=False)#

Logs an info message prefixed with the strategy name.

Uses python logging to log the message at the info level. Logging goes to the logging file, not the console.

Parameters:
  • message (str) – String message for logging.

  • color (str) – Color of the message. Eg. “red” or “green”.

  • broadcast (bool) – If True, the message will be broadcasted to any connected message services.

Returns:

message – Strategy name plus the original message.

Return type:

str

Example

>>> self.log_message('Sending a buy order')