diff options
author | Azul <azul@riseup.net> | 2016-09-30 11:59:20 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-09-30 11:59:20 +0200 |
commit | 8ee1d1cb70bee8c938966e4e042b4929ced8b1a3 (patch) | |
tree | 99d3a5c5ded96b84924b582f615d662536f5bb0a /lib/nickserver/logging_responder.rb | |
parent | 997af2eea91263b1d6c07e02a98f02f81a320acf (diff) |
logging: use proper logger
This way the logs do not interfere with test output
Diffstat (limited to 'lib/nickserver/logging_responder.rb')
-rw-r--r-- | lib/nickserver/logging_responder.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/nickserver/logging_responder.rb b/lib/nickserver/logging_responder.rb new file mode 100644 index 0000000..6eb756f --- /dev/null +++ b/lib/nickserver/logging_responder.rb @@ -0,0 +1,18 @@ +module Nickserver + class LoggingResponder + + def initialize(responder, logger) + @responder = responder + @logger = logger + end + + def respond(status, body) + logger.info " -> #{status}" + responder.respond(status, body) + end + + protected + + attr_reader :responder, :logger + end +end |