Class: ActiveStash::Logger
- Inherits:
-
Object
- Object
- ActiveStash::Logger
- Defined in:
- lib/active_stash/logger.rb
Class Method Summary collapse
- .debug(message) ⇒ Object
- .error(message) ⇒ Object
- .info(message) ⇒ Object
- .instance ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
4 5 6 |
# File 'lib/active_stash/logger.rb', line 4 def debug() instance.debug("ActiveStash: #{}") end |
.error(message) ⇒ Object
16 17 18 |
# File 'lib/active_stash/logger.rb', line 16 def error() instance.error(" \e[31m\e[1mActiveStash ERROR\e[22m: #{}\e[0m") end |
.info(message) ⇒ Object
8 9 10 |
# File 'lib/active_stash/logger.rb', line 8 def info() instance.info(" \e[36m\e[1mActiveStash\e[22m: #{}\e[0m") end |
.instance ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/active_stash/logger.rb', line 20 def instance return @logger if @logger if defined?(Rails) && Rails.logger @logger = Rails.logger else @logger = ::Logger.new(STDOUT, level: :debug) end end |
.warn(message) ⇒ Object
12 13 14 |
# File 'lib/active_stash/logger.rb', line 12 def warn() instance.warn(" \e[33m\e[1mActiveStash WARNING\e[22m: #{}\e[0m") end |