forked from crystal-lang-tools/scry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use deprecated Logger class. See crystal-lang/crystal#8847
- Loading branch information
Marcos Sánchez
committed
Apr 21, 2020
1 parent
836950d
commit c1201c5
Showing
12 changed files
with
36 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
require "logger" | ||
require "log" | ||
require "log/io_backend" | ||
require "./client" | ||
|
||
module Scry | ||
module Log | ||
class_property logger : Logger = Logger.new(nil) | ||
|
||
class ClientLogger < Logger | ||
def initialize(@client : Client) | ||
super(@client.io) | ||
end | ||
|
||
private def write(severity, datetime, progname, message) | ||
message_type = case severity | ||
when INFO | ||
LSP::Protocol::MessageType::Info | ||
when WARN | ||
LSP::Protocol::MessageType::Warning | ||
when ERROR, FATAL | ||
LSP::Protocol::MessageType::Error | ||
else | ||
LSP::Protocol::MessageType::Log | ||
end | ||
@client.send("window/logMessage", LSP::Protocol::LogMessageParams.new(message_type, message.to_s)) | ||
end | ||
end | ||
class_property logger : ::Log = ::Log.for(self) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters