Class: AdLocalize::AdLogger
- Inherits:
-
Object
- Object
- AdLocalize::AdLogger
- Defined in:
- lib/ad_localize/ad_logger.rb
Instance Method Summary collapse
- #close ⇒ Object
- #debug(text) ⇒ Object
- #debug! ⇒ Object
- #debug? ⇒ Boolean
- #error(text) ⇒ Object
- #info(text) ⇒ Object
- #info! ⇒ Object
-
#initialize ⇒ AdLogger
constructor
A new instance of AdLogger.
- #warn(text) ⇒ Object
Constructor Details
#initialize ⇒ AdLogger
Returns a new instance of AdLogger.
4 5 6 7 |
# File 'lib/ad_localize/ad_logger.rb', line 4 def initialize @logger = Logger.new(STDOUT) @logger.level = Logger::INFO end |
Instance Method Details
#close ⇒ Object
37 38 39 |
# File 'lib/ad_localize/ad_logger.rb', line 37 def close @logger.close end |
#debug(text) ⇒ Object
21 22 23 |
# File 'lib/ad_localize/ad_logger.rb', line 21 def debug(text) @logger.debug(text) end |
#debug! ⇒ Object
29 30 31 |
# File 'lib/ad_localize/ad_logger.rb', line 29 def debug! @logger.level = Logger::DEBUG end |
#debug? ⇒ Boolean
33 34 35 |
# File 'lib/ad_localize/ad_logger.rb', line 33 def debug? @logger.debug? end |
#error(text) ⇒ Object
17 18 19 |
# File 'lib/ad_localize/ad_logger.rb', line 17 def error(text) @logger.error(text.red) end |
#info(text) ⇒ Object
13 14 15 |
# File 'lib/ad_localize/ad_logger.rb', line 13 def info(text) @logger.info(text.blue) end |
#info! ⇒ Object
25 26 27 |
# File 'lib/ad_localize/ad_logger.rb', line 25 def info! @logger.level = Logger::INFO end |
#warn(text) ⇒ Object
9 10 11 |
# File 'lib/ad_localize/ad_logger.rb', line 9 def warn(text) @logger.warn(text.yellow) end |