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.
172 173 174 175 176 |
# File 'lib/neovim/logging.rb', line 172 def initialize file super require "json" require "time" end |
Instance Method Details
#put(**fields) ⇒ Object
177 178 179 180 181 |
# File 'lib/neovim/logging.rb', line 177 def put **fields fields[ :time] = fields[ :time].iso8601 rescue nil @file.puts fields.to_json @file.flush end |