Class: Chef::NullLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/null_logger.rb

Overview

Null logger implementation that just ignores everything. This is used by classes that are intended to be reused outside of Chef, but need to offer logging functionality when used by other Chef code.

It does not define the full interface provided by Logger, just enough to be a reasonable duck type. In particular, methods setting the log level, log device, etc., are not implemented because any code calling those methods probably expected a real logger and not this “fake” one.

Instance Method Summary collapse

Instance Method Details

#<<(message) ⇒ Object



48
49
# File 'lib/chef/null_logger.rb', line 48

def <<(message)
end

#add(severity, message = nil, progname = nil) ⇒ Object



45
46
# File 'lib/chef/null_logger.rb', line 45

def add(severity, message=nil, progname=nil)
end

#debug(message, &block) ⇒ Object



42
43
# File 'lib/chef/null_logger.rb', line 42

def debug(message, &block)
end

#debug?Boolean



67
68
69
# File 'lib/chef/null_logger.rb', line 67

def debug?
  false
end

#error(message, &block) ⇒ Object



33
34
# File 'lib/chef/null_logger.rb', line 33

def error(message, &block)
end

#error?Boolean



55
56
57
# File 'lib/chef/null_logger.rb', line 55

def error?
  false
end

#fatal(message, &block) ⇒ Object



30
31
# File 'lib/chef/null_logger.rb', line 30

def fatal(message, &block)
end

#fatal?Boolean



51
52
53
# File 'lib/chef/null_logger.rb', line 51

def fatal?
  false
end

#info(message, &block) ⇒ Object



39
40
# File 'lib/chef/null_logger.rb', line 39

def info(message, &block)
end

#info?Boolean



63
64
65
# File 'lib/chef/null_logger.rb', line 63

def info?
  false
end

#warn(message, &block) ⇒ Object



36
37
# File 'lib/chef/null_logger.rb', line 36

def warn(message, &block)
end

#warn?Boolean



59
60
61
# File 'lib/chef/null_logger.rb', line 59

def warn?
  false
end