Class: Scrubyt::Logger
- Inherits:
-
Object
- Object
- Scrubyt::Logger
- Defined in:
- lib/scrubyt/logging.rb
Overview
Defined Under Namespace
Classes: Message, MultiLineMessage
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(*levels) ⇒ Logger
constructor
A new instance of Logger.
- #log(level, message) ⇒ Object
Constructor Details
#initialize(*levels) ⇒ Logger
Returns a new instance of Logger.
63 64 65 |
# File 'lib/scrubyt/logging.rb', line 63 def initialize(*levels) @levels = levels end |
Instance Attribute Details
#output_stream ⇒ Object
75 76 77 |
# File 'lib/scrubyt/logging.rb', line 75 def output_stream @output_stream || STDERR end |
Instance Method Details
#log(level, message) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/scrubyt/logging.rb', line 67 def log(level, ) return unless logging?(level) = .is_a?(Array) ? MultiLineMessage : Message output_stream.puts .new(level, ) end |