Class: Slf4r::AbstractLoggerFacade

Inherits:
Object
  • Object
show all
Defined in:
lib/slf4r/abstract_logger_facade.rb

Direct Known Subclasses

LoggerFacade

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ AbstractLoggerFacade

Returns a new instance of AbstractLoggerFacade.



35
36
37
# File 'lib/slf4r/abstract_logger_facade.rb', line 35

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



33
34
35
# File 'lib/slf4r/abstract_logger_facade.rb', line 33

def name
  @name
end

Instance Method Details

#debug(msg = nil, exception = nil) ⇒ Object



43
44
45
46
47
48
# File 'lib/slf4r/abstract_logger_facade.rb', line 43

def debug(msg = nil, exception = nil)
  if(debug?)
    msg, exception = yield if block_given?
    _debug("#{msg}#{format(exception)}")
  end
end

#debug?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/slf4r/abstract_logger_facade.rb', line 39

def debug?
  raise NotImplementedError
end

#error(msg = nil, exception = nil) ⇒ Object



76
77
78
79
80
81
# File 'lib/slf4r/abstract_logger_facade.rb', line 76

def error(msg = nil, exception = nil)
  if(error?)
    msg, exception = yield if block_given?
    _error("#{msg}#{format(exception)}")
  end
end

#error?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


72
73
74
# File 'lib/slf4r/abstract_logger_facade.rb', line 72

def error?
  raise NotImplementedError
end

#fatal(msg = nil, exception = nil) ⇒ Object



87
88
89
90
91
92
# File 'lib/slf4r/abstract_logger_facade.rb', line 87

def fatal(msg = nil, exception = nil)
  if(fatal?)
    msg, exception = yield if block_given?
    _fatal("#{msg}#{format(exception)}")
  end
end

#fatal?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


83
84
85
# File 'lib/slf4r/abstract_logger_facade.rb', line 83

def fatal?
  raise NotImplementedError
end

#info(msg = nil, exception = nil) ⇒ Object



54
55
56
57
58
59
# File 'lib/slf4r/abstract_logger_facade.rb', line 54

def info(msg = nil, exception = nil)
  if(info?)
    msg, exception = yield if block_given?
    _info("#{msg}#{format(exception)}")
  end
end

#info?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


50
51
52
# File 'lib/slf4r/abstract_logger_facade.rb', line 50

def info?
  raise NotImplementedError
end

#warn(msg = nil, exception = nil) ⇒ Object



65
66
67
68
69
70
# File 'lib/slf4r/abstract_logger_facade.rb', line 65

def warn(msg = nil, exception = nil)
  if(warn?)
    msg, exception = yield if block_given?
    _warn("#{msg}#{format(exception)}")
  end
end

#warn?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


61
62
63
# File 'lib/slf4r/abstract_logger_facade.rb', line 61

def warn?
  raise NotImplementedError
end