aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorre4k <re4k@re4k.info>2013-04-04 19:20:51 +0900
committerre4k <re4k@re4k.info>2013-04-04 19:20:51 +0900
commit84183b7bb1c42a80b323ea3caef30467dcde23a6 (patch)
treec248d894619fce6c585747dff5f8f03c15d989c4 /lib
parent61dde16fd55babd2ccf5ff6a9c8be1f600868d9b (diff)
downloadaclog-84183b7bb1c42a80b323ea3caef30467dcde23a6.tar.gz
Add test(partial)
Diffstat (limited to 'lib')
-rw-r--r--lib/aclog/notification.rb4
-rw-r--r--lib/receiver/logger.rb42
2 files changed, 2 insertions, 44 deletions
diff --git a/lib/aclog/notification.rb b/lib/aclog/notification.rb
index b2a89ba..85919a3 100644
--- a/lib/aclog/notification.rb
+++ b/lib/aclog/notification.rb
@@ -16,8 +16,8 @@ module Aclog
begin
@@account.update("@#{user.screen_name} #{text} #{url}", :in_reply_to_status_id => tweet.id)
rescue Exception
- logger.error($!)
- logger.error($@)
+ Rails.logger.error($!)
+ Rails.logger.error($@)
end
end
end
diff --git a/lib/receiver/logger.rb b/lib/receiver/logger.rb
deleted file mode 100644
index e1ecf56..0000000
--- a/lib/receiver/logger.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-class Receiver::Logger
- def debug(msg)
- if @level == :debug
- log(@out, "DEBUG", msg)
- end
- end
-
- def info(msg)
- unless @level == :none
- @level == :error
- @level == :warn
- log(@out, "INFO", msg)
- end
- end
-
- def warn(msg)
- unless @level == :none
- @level == :error
- log(@err, "WARN", msg)
- end
- end
-
- def error(msg)
- unless @level == :none
- log(@err, "ERROR", msg)
- end
- end
-
- def fatal(msg)
- log(@err, "FATAL", msg)
- end
-
- def log(out, type, msg)
- out.puts Time.now.utc.iso8601(3) + " " + type + ": " + msg.to_s
- end
-
- def initialize(level = :warn)
- @out = STDOUT
- @err = STDERR
- @level = level
- end
-end