Class: Hooksmith::Logger
- Inherits:
-
Object
- Object
- Hooksmith::Logger
- Includes:
- Singleton
- Defined in:
- lib/hooksmith/logger.rb
Overview
A lightweight logger for Hooksmith.
Uses Ruby's standard Logger under the hood and can be configured to use Rails.logger.
Instance Method Summary collapse
-
#debug(msg) ⇒ Object
Logs a debug message.
-
#error(msg) ⇒ Object
Logs an error message.
-
#info(msg) ⇒ Object
Logs an info message.
-
#initialize ⇒ Logger
constructor
Initializes the logger.
-
#warn(msg) ⇒ Object
Logs a warning message.
Constructor Details
#initialize ⇒ Logger
Initializes the logger.
14 15 16 17 |
# File 'lib/hooksmith/logger.rb', line 14 def initialize @logger = ::Logger.new($stdout) @logger.level = ::Logger::INFO end |
Instance Method Details
#debug(msg) ⇒ Object
Logs a debug message.
43 44 45 |
# File 'lib/hooksmith/logger.rb', line 43 def debug(msg) @logger.debug(msg) end |
#error(msg) ⇒ Object
Logs an error message.
36 37 38 |
# File 'lib/hooksmith/logger.rb', line 36 def error(msg) @logger.error(msg) end |
#info(msg) ⇒ Object
Logs an info message.
22 23 24 |
# File 'lib/hooksmith/logger.rb', line 22 def info(msg) @logger.info(msg) end |
#warn(msg) ⇒ Object
Logs a warning message.
29 30 31 |
# File 'lib/hooksmith/logger.rb', line 29 def warn(msg) @logger.warn(msg) end |