Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scribe to 2.7.10 and remove duplicate newline #1137

Merged
merged 1 commit into from Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.sbt
Expand Up @@ -275,8 +275,8 @@ lazy val metals = project
// for fetching ch.epfl.scala:bloop-frontend and other library dependencies
"io.get-coursier" % "interface" % "0.0.14",
// for logging
"com.outr" %% "scribe" % "2.6.0",
"com.outr" %% "scribe-slf4j" % "2.6.0", // needed for flyway database migrations
"com.outr" %% "scribe" % "2.7.10",
"com.outr" %% "scribe-slf4j" % "2.7.10", // needed for flyway database migrations
// for debugging purposes, not strictly needed but nice for productivity
"com.lihaoyi" %% "pprint" % "0.5.6",
// for producing SemanticDB from Scala source files
Expand Down
Expand Up @@ -4,15 +4,16 @@ import org.eclipse.lsp4j.MessageParams
import org.eclipse.lsp4j.MessageType
import scribe.LogRecord
import scribe.writer.Writer
import scribe.output.LogOutput

/**
* Scribe logging handler that forwards logging messages to the LSP editor client.
*/
object LanguageClientLogger extends Writer {
var languageClient: Option[MetalsLanguageClient] = None
override def write[M](record: LogRecord[M], output: String): Unit = {
override def write[M](record: LogRecord[M], output: LogOutput): Unit = {
languageClient.foreach { client =>
client.logMessage(new MessageParams(MessageType.Log, record.message))
client.logMessage(new MessageParams(MessageType.Log, output.plainText))
}
}
}
Expand Up @@ -99,7 +99,7 @@ object MetalsLogger {
def newFileWriter(logfile: AbsolutePath): FileWriter =
FileWriter().path(_ => logfile.toNIO).autoFlush

def defaultFormat: Formatter = formatter"$levelPaddedRight $message$newLine"
def defaultFormat: Formatter = formatter"$levelPaddedRight $message"

def silent: LoggerSupport = new LoggerSupport {
override def log[M](record: LogRecord[M]): Unit = ()
Expand Down