Class: AdLocalize::AdLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_localize/ad_logger.rb

Instance Method Summary collapse

Constructor Details

#initializeAdLogger

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

#closeObject



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

Returns:

  • (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