lib/conveyor/output.rb in gina-conveyor-0.0.2 vs lib/conveyor/output.rb in gina-conveyor-0.1.0
- old
+ new
@@ -1,17 +1,19 @@
require 'conveyor/output/console'
require 'conveyor/output/email'
require 'conveyor/output/logfile'
require 'conveyor/output/channel'
+require 'conveyor/output/campfire'
module Conveyor
module Output
MSGLVLS = {
:debug => 1,
:info => 10,
:warning => 20,
- :error => 30
+ :error => 30,
+ :announce => 40
}
def should_log?(lvl, maxlvl = nil)
if maxlvl.nil? && @loglvl.nil?
loglvl :debug
@@ -55,15 +57,20 @@
def debug(*msg)
output(:debug, *msg)
end
+ def announce(*msg)
+ output(:announce, *msg)
+ end
+
def output(msgtype, *msg)
return false unless should_log?(msgtype)
- Console.send(msgtype, *msg)
+ Console.write(msgtype, *msg)
Logfile.write(logfile, name, msgtype, *msg)
- Email.send(msgtype, *msg)
+ Email.write(msgtype, *msg)
Channel.instance.write(name, msgtype, *msg)
+ Campfire.instance.write(name, msgtype, *msg)
end
def send_notifications
Email.mail
end
\ No newline at end of file