Class: NOMS::Command::Window::Console
- Defined in:
- lib/noms/command/window.rb
Instance Method Summary collapse
- #_sanitize(s) ⇒ Object
-
#initialize(logger = nil) ⇒ Console
constructor
A new instance of Console.
-
#log(*items) ⇒ Object
Some implementations have a kind of format string.
Methods inherited from Base
Constructor Details
#initialize(logger = nil) ⇒ Console
Returns a new instance of Console.
51 52 53 |
# File 'lib/noms/command/window.rb', line 51 def initialize(logger=nil) @log = logger || default_logger end |
Instance Method Details
#_sanitize(s) ⇒ Object
60 61 62 |
# File 'lib/noms/command/window.rb', line 60 def _sanitize(s) s.respond_to?(:to_str) ? s : s.to_json end |
#log(*items) ⇒ Object
Some implementations have a kind of format string. I don’t
56 57 58 |
# File 'lib/noms/command/window.rb', line 56 def log(*items) @log.debug(items.map { |s| _sanitize(s) }.join(', ')) end |