Class: R2OAS::StdoutLogger

Inherits:
Object show all
Defined in:
lib/r2-oas/logger/stdout_logger.rb

Defined Under Namespace

Classes: Formatter

Constant Summary collapse

DEBUG =
0
INFO =
1
WARN =
2
ERROR =
3
FATAL =
4
UNKNOWN =
5
NULL =
6
SEV_LABEL =

Severity label for logging (max 5 chars).

%w[DEBUG INFO WARN ERROR FATAL NULL ANY].each(&:freeze).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStdoutLogger

Returns a new instance of StdoutLogger.



19
20
21
22
23
24
# File 'lib/r2-oas/logger/stdout_logger.rb', line 19

def initialize
  @progname = nil
  @level = INFO
  @default_formatter = Formatter.new
  @formatter = nil
end

Instance Attribute Details

#levelObject

Logging severity threshold (e.g. Logger::INFO).



17
18
19
# File 'lib/r2-oas/logger/stdout_logger.rb', line 17

def level
  @level
end

Instance Method Details

#debug(progname = nil) ⇒ Object



55
56
57
# File 'lib/r2-oas/logger/stdout_logger.rb', line 55

def debug(progname = nil)
  add(DEBUG, nil, progname)
end

#error(progname = nil) ⇒ Object



67
68
69
# File 'lib/r2-oas/logger/stdout_logger.rb', line 67

def error(progname = nil)
  add(ERROR, nil, progname)
end

#fatal(progname = nil) ⇒ Object



71
72
73
# File 'lib/r2-oas/logger/stdout_logger.rb', line 71

def fatal(progname = nil)
  add(FATAL, nil, progname)
end

#info(progname = nil) ⇒ Object



59
60
61
# File 'lib/r2-oas/logger/stdout_logger.rb', line 59

def info(progname = nil)
  add(INFO, nil, progname)
end

#unknown(progname = nil) ⇒ Object



75
76
77
# File 'lib/r2-oas/logger/stdout_logger.rb', line 75

def unknown(progname = nil)
  add(UNKNOWN, nil, progname)
end

#warn(progname = nil) ⇒ Object



63
64
65
# File 'lib/r2-oas/logger/stdout_logger.rb', line 63

def warn(progname = nil)
  add(WARN, nil, progname)
end