Class: Neovim::Logging::Json
- Defined in:
- lib/neovim/logging.rb
Constant Summary collapse
- NAME =
"json"
Constants inherited from Logger
Instance Method Summary collapse
-
#initialize(file) ⇒ Json
constructor
A new instance of Json.
- #put(**fields) ⇒ Object
Methods inherited from Stream
Methods inherited from Logger
Constructor Details
#initialize(file) ⇒ Json
Returns a new instance of Json.
181 182 183 184 185 |
# File 'lib/neovim/logging.rb', line 181 def initialize file super require "json" require "time" end |
Instance Method Details
#put(**fields) ⇒ Object
186 187 188 189 190 |
# File 'lib/neovim/logging.rb', line 186 def put **fields fields[ :time] = fields[ :time].iso8601 rescue nil @file.puts fields.to_json @file.flush end |