Class: Sh::Log
Defined Under Namespace
Classes: Broadcaster
Constant Summary collapse
- LEVELS =
[:debug, :info, :warning, :error]
- @@output_streams =
[]
- @@stdout =
$stdout
- @@stderr =
$stderr
Class Method Summary collapse
- .add_output_stream(stream, level = :debug) ⇒ Object
- .debug(message, error = nil) ⇒ Object
- .error(message, error = nil) ⇒ Object
- .info(message, error = nil) ⇒ Object
- .warning(message, error = nil) ⇒ Object
Class Method Details
.add_output_stream(stream, level = :debug) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/sh_log.rb', line 34 def self.add_output_stream stream, level=:debug case stream when :stdout stream = @@stdout when :stderr stream = @@stderr end @@output_streams << [stream, level] end |
.debug(message, error = nil) ⇒ Object
44 45 46 |
# File 'lib/sh_log.rb', line 44 def self.debug(, error=nil) log , :debug, error end |
.error(message, error = nil) ⇒ Object
56 57 58 |
# File 'lib/sh_log.rb', line 56 def self.error(, error=nil) log , :error, error end |
.info(message, error = nil) ⇒ Object
48 49 50 |
# File 'lib/sh_log.rb', line 48 def self.info(, error=nil) log , :info, error end |
.warning(message, error = nil) ⇒ Object
52 53 54 |
# File 'lib/sh_log.rb', line 52 def self.warning(, error=nil) log , :warning, error end |