mispy/twitter_ebooks — pull request #61 by Stawberri (2014-12-14 04:57:53+00:00)
Title: Allow custom user formatting of log output

> Allows users to create an on_log method in their bots that determines
> what their log outputs look like.

The current log format is still the default, and this implementation reverts to it if on_log is missing or does not return a string containing log_message. If it returns anything other than that, it'll also provide a helpful warning so users know that their method is getting detected--it just doesn't output anything that would be useful for their logs!

Example usage (with a timestamp borrowed from #55):
``` ruby
def on_log(bot_name, log_message)
# Add a timestamp to console logs this bot makes
# "#{Time.now.strftime('%c')} - #{bot_name}: #{log_message}"
end
```