Class: Neovim::Logging::Stream
Constant Summary
Constants inherited from Logger
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, **kwargs) ⇒ Stream
constructor
A new instance of Stream.
Methods inherited from Logger
Constructor Details
#initialize(file, **kwargs) ⇒ Stream
Returns a new instance of Stream.
115 116 117 |
# File 'lib/neovim/logging.rb', line 115 def initialize file, **kwargs @file = file end |
Class Method Details
.open(path = nil, **kwargs) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/neovim/logging.rb', line 99 def open path = nil, **kwargs if path.notempty? and path != "-" then params = {} %i(external_encoding newline).each do |k| v = kwargs.delete k params[ k] = v if v end File.open path, "a", **params do |f| yield (new f, **kwargs) end else yield (new $stderr, **kwargs) end end |