Class: Rox::Server::ServerLogger
- Inherits:
-
Object
- Object
- Rox::Server::ServerLogger
- Defined in:
- lib/rox/server/logging/server_logger.rb
Instance Method Summary collapse
- #debug(message, ex = nil) ⇒ Object
- #error(message, ex = nil) ⇒ Object
-
#initialize ⇒ ServerLogger
constructor
A new instance of ServerLogger.
- #warn(message, ex = nil) ⇒ Object
Constructor Details
#initialize ⇒ ServerLogger
Returns a new instance of ServerLogger.
6 7 8 |
# File 'lib/rox/server/logging/server_logger.rb', line 6 def initialize @logger = Logger.new($stdout) end |
Instance Method Details
#debug(message, ex = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rox/server/logging/server_logger.rb', line 10 def debug(, ex = nil) if ex.nil? @logger.debug() else @logger.debug("#{}. Exception: #{ex}") end end |
#error(message, ex = nil) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rox/server/logging/server_logger.rb', line 18 def error(, ex = nil) if ex.nil? @logger.error() else @logger.error("#{}. Exception: #{ex}") end end |
#warn(message, ex = nil) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rox/server/logging/server_logger.rb', line 26 def warn(, ex = nil) if ex.nil? @logger.warn() else @logger.warn("#{}. Exception: #{ex}") end end |