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
36 37 38 39 40 41 42 43 44 |
# File 'lib/sh_log.rb', line 36 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
46 47 48 |
# File 'lib/sh_log.rb', line 46 def self.debug(, error=nil) log , :debug, error end |
.error(message, error = nil) ⇒ Object
58 59 60 |
# File 'lib/sh_log.rb', line 58 def self.error(, error=nil) log , :error, error end |
.info(message, error = nil) ⇒ Object
50 51 52 |
# File 'lib/sh_log.rb', line 50 def self.info(, error=nil) log , :info, error end |
.warning(message, error = nil) ⇒ Object
54 55 56 |
# File 'lib/sh_log.rb', line 54 def self.warning(, error=nil) log , :warning, error end |