Module: Commons::Logging::Log

Included in:
Impl::Log4rLogger, Impl::NoOpLog, Impl::SimpleLog
Defined in:
lib/commons/logging/log.rb

Constant Summary collapse

TRACE =
:TRACE
DEBUG =
:DEBUG
INFO =
:INFO
WARN =
:WARN
ERROR =
:ERROR
FATAL =
:FATAL

Instance Method Summary collapse

Instance Method Details

#debug(message, exception = nil) ⇒ Object



50
51
52
# File 'lib/commons/logging/log.rb', line 50

def debug(message, exception = nil)
  log(DEBUG, message, exception)
end

#debug?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/commons/logging/log.rb', line 80

def debug?
  return enabled_for?(DEBUG)
end

#error(message, exception = nil) ⇒ Object



65
66
67
# File 'lib/commons/logging/log.rb', line 65

def error(message, exception = nil)
  log(ERROR, message, exception)
end

#error?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/commons/logging/log.rb', line 95

def error?
  return enabled_for?(ERROR)
end

#fatal(message, exception = nil) ⇒ Object



70
71
72
# File 'lib/commons/logging/log.rb', line 70

def fatal(message, exception = nil)
  log(FATAL, message, exception)
end

#fatal?Boolean

Returns:

  • (Boolean)


100
101
102
# File 'lib/commons/logging/log.rb', line 100

def fatal?
  return enabled_for?(FATAL)
end

#info(message, exception = nil) ⇒ Object



55
56
57
# File 'lib/commons/logging/log.rb', line 55

def info(message, exception = nil)
  log(INFO, message, exception)
end

#info?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/commons/logging/log.rb', line 85

def info?
  return enabled_for?(INFO)
end

#trace(message, exception = nil) ⇒ Object



45
46
47
# File 'lib/commons/logging/log.rb', line 45

def trace(message, exception = nil)
  log(TRACE, message, exception)
end

#trace?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/commons/logging/log.rb', line 75

def trace?
  return enabled_for?(TRACE)
end

#warn(message, exception = nil) ⇒ Object



60
61
62
# File 'lib/commons/logging/log.rb', line 60

def warn(message, exception = nil)
  log(WARN, message, exception)
end

#warn?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/commons/logging/log.rb', line 90

def warn?
  return enabled_for?(WARN)
end