Class: Gemstash::Logging::StreamLogger
- Inherits:
-
Object
- Object
- Gemstash::Logging::StreamLogger
- Defined in:
- lib/gemstash/logging.rb
Overview
Logger that looks like a stream, for Puma and Rack to log to.
Class Method Summary collapse
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(level) ⇒ StreamLogger
constructor
A new instance of StreamLogger.
- #puts(message) ⇒ Object
- #sync=(_value) ⇒ Object
- #write(message) ⇒ Object
Constructor Details
#initialize(level) ⇒ StreamLogger
Returns a new instance of StreamLogger.
74 75 76 |
# File 'lib/gemstash/logging.rb', line 74 def initialize(level) @level = level end |
Class Method Details
.for_stderr ⇒ Object
70 71 72 |
# File 'lib/gemstash/logging.rb', line 70 def self.for_stderr new(Logger::ERROR) end |
.for_stdout ⇒ Object
66 67 68 |
# File 'lib/gemstash/logging.rb', line 66 def self.for_stdout new(Logger::INFO) end |
.puma_events ⇒ Object
62 63 64 |
# File 'lib/gemstash/logging.rb', line 62 def self.puma_events Puma::Events.new(for_stdout, for_stderr) end |
Instance Method Details
#flush ⇒ Object
78 79 |
# File 'lib/gemstash/logging.rb', line 78 def flush end |
#puts(message) ⇒ Object
88 89 90 |
# File 'lib/gemstash/logging.rb', line 88 def puts() Gemstash::Logging.logger.add(@level, ) end |
#sync=(_value) ⇒ Object
81 82 |
# File 'lib/gemstash/logging.rb', line 81 def sync=(_value) end |