Class: Cinch::Logger::ZcbotLogger

Inherits:
Cinch::Logger show all
Defined in:
lib/cinch/logger/zcbot_logger.rb

Overview

This logger logs all incoming messages in the format of zcbot. All other debug output (outgoing messages, exceptions, …) will silently be dropped. The sole purpose of this logger is to produce logs parseable by pisg (with the zcbot formatter) to create channel statistics..

Constant Summary

Constants inherited from Cinch::Logger

LEVEL_ORDER

Instance Attribute Summary

Attributes inherited from Cinch::Logger

#level, #mutex, #output

Instance Method Summary collapse

Methods inherited from Cinch::Logger

#debug, #error, #exception, #fatal, #incoming, #info, #initialize, #outgoing, #warn, #will_log?

Constructor Details

This class inherits a constructor from Cinch::Logger

Instance Method Details

#log(messages, event, level = event) ⇒ void

This method returns an undefined value.

Logs a message.

Parameters:

  • messages (String, Array)

    The message(s) to log

  • event (:debug, :incoming, :outgoing, :info, :warn, :exception, :error, :fatal)

    The kind of event that triggered the message

  • level (:debug, :info, :warn, :error, :fatal) (defaults to: event)

    The level of the message

Version:

  • 2.0.0



14
15
16
17
# File 'lib/cinch/logger/zcbot_logger.rb', line 14

def log(messages, event, level = event)
  return if event != :incoming
  super
end