Class: Bunto::Assets::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/bunto/assets/logger.rb

Constant Summary collapse

PREFIX =
"Bunto Assets:"

Instance Method Summary collapse

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

#logObject



12
13
14
# File 'lib/bunto/assets/logger.rb', line 12

def log
  @_log ||= Bunto.logger
end

#log_level=Object


Raises:

  • (RuntimeError)


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