Class: R2OAS::StdoutLogger
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
-
#level ⇒ Object
Logging severity threshold (e.g.
Logger::INFO
).
Instance Method Summary collapse
- #debug(progname = nil) ⇒ Object
- #error(progname = nil) ⇒ Object
- #fatal(progname = nil) ⇒ Object
- #info(progname = nil) ⇒ Object
-
#initialize ⇒ StdoutLogger
constructor
A new instance of StdoutLogger.
- #unknown(progname = nil) ⇒ Object
- #warn(progname = nil) ⇒ Object
Constructor Details
#initialize ⇒ StdoutLogger
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
#level ⇒ Object
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 |