Class: Standard::Lsp::Logger
- Inherits:
-
Object
- Object
- Standard::Lsp::Logger
- Defined in:
- lib/standard/lsp/logger.rb
Instance Method Summary collapse
-
#initialize(prefix: "[server]") ⇒ Logger
constructor
A new instance of Logger.
- #puts(message) ⇒ Object
- #puts_once(message) ⇒ Object
Constructor Details
#initialize(prefix: "[server]") ⇒ Logger
Returns a new instance of Logger.
4 5 6 7 |
# File 'lib/standard/lsp/logger.rb', line 4 def initialize(prefix: "[server]") @prefix = prefix @puts_onces = [] end |
Instance Method Details
#puts(message) ⇒ Object
9 10 11 |
# File 'lib/standard/lsp/logger.rb', line 9 def puts() warn [@prefix, ].compact.join(" ") end |
#puts_once(message) ⇒ Object
13 14 15 16 17 |
# File 'lib/standard/lsp/logger.rb', line 13 def puts_once() return if @puts_onces.include?() @puts_onces << puts() end |