Class: Bunto::Assets::Logger
- Inherits:
-
Object
- Object
- Bunto::Assets::Logger
- Defined in:
- lib/bunto/assets/logger.rb
Constant Summary collapse
- PREFIX =
"Bunto Assets:"
Instance Method Summary collapse
-
#debug(msg = nil, &block) ⇒ Object
———————————————————————- Log Level: 3 ———————————————————————-.
-
#error(msg = nil, &block) ⇒ Object
———————————————————————- Log Level: 1 ———————————————————————-.
-
#info(msg = nil, &block) ⇒ Object
———————————————————————- Log Level: 2 ———————————————————————-.
- #log ⇒ Object
-
#log_level= ⇒ Object
———————————————————————-.
-
#warn(msg = nil, &block) ⇒ Object
———————————————————————- Log Level: 1 ———————————————————————-.
Instance Method Details
#debug(msg = nil, &block) ⇒ Object
Log Level: 3
47 48 49 50 |
# File 'lib/bunto/assets/logger.rb', line 47 def debug(msg = nil, &block) msg = (block_given?? block.call : msg) log.debug(PREFIX, msg) end |
#error(msg = nil, &block) ⇒ Object
Log Level: 1
29 30 31 32 |
# File 'lib/bunto/assets/logger.rb', line 29 def error(msg = nil, &block) msg = (block_given?? block.call : msg) log.error(PREFIX, msg) end |
#info(msg = nil, &block) ⇒ Object
Log Level: 2
38 39 40 41 |
# File 'lib/bunto/assets/logger.rb', line 38 def info(msg = nil, &block) msg = (block_given?? block.call : msg) log.info(PREFIX, msg) end |
#log ⇒ Object
12 13 14 |
# File 'lib/bunto/assets/logger.rb', line 12 def log @_log ||= Bunto.logger end |
#log_level= ⇒ Object
54 55 56 |
# File 'lib/bunto/assets/logger.rb', line 54 def log_level=(*) raise RuntimeError, "Please set log levels on Bunto.logger" end |
#warn(msg = nil, &block) ⇒ Object
Log Level: 1
20 21 22 23 |
# File 'lib/bunto/assets/logger.rb', line 20 def warn(msg = nil, &block) msg = (block_given?? block.call : msg) log.warn(PREFIX, msg) end |