Log Method

Besides the logging that Gopherbot does on it's own, plugins can also emit log messages with one of the following log levels:

  • Trace - for fine-grained logging of all actions
  • Debug - for emitting debugging info
  • Info - the default log level
  • Audit - for auditable events - NOTE: Audit events are always logged regardless of the current log level
  • Warn - for potentially harmful events
  • Error - for errors
  • Fatal - emit fatal error and cause robot to exit(1)

Bash

Log "Error" "The robot broke"

Python

bot.Log("Error", "The robot broke")

Ruby

bot.Log(:error, "The robot broke")
# or
bot.Log("Error", "The robot broke")

Symbols look better and work just fine.

Pause Method

Every language has some means of sleeping / pausing, and this method is provided as a convenience to plugin authors and implemented natively. It takes a single argument, time in seconds.

Bash

Say "Be back soon!"
Pause 2
Say "... aaaand I'm back!"

Python

bot.Say("Be back soon!")
bot.Pause(2)
bot.Say("... aaaand I'm back!")

Ruby

bot.Say("Be back soon!")
bot.Pause(2)
bot.Say("... aaaand I'm back!")