Skip to content
This repository has been archived by the owner on Jan 20, 2019. It is now read-only.

Replace logback with scribe #3

Merged
merged 4 commits into from
Apr 27, 2018
Merged

Replace logback with scribe #3

merged 4 commits into from
Apr 27, 2018

Conversation

olafurpg
Copy link
Member

No description provided.

@olafurpg olafurpg requested a review from gabro April 26, 2018 23:35
}

object Logger {
object StdoutLogger extends Logger {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep bells and whistles to an absolute minimum while still having at least one out-of-the-box working logger that doesn't suck.

@@ -0,0 +1,17 @@
package scala.meta.jsonrpc

class SourceLocation(val file: String, val line: Int) {
Copy link
Member Author

@olafurpg olafurpg Apr 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source location for error messages is too helpful for debugging that I couldn't resist to introduce this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic for us because when we extend it we need to implement it, and our loggers don't use source locations. Would it be possible you introduce implicit locations in an internal logger that extends the logger interface you'd expose to implementors?

@olafurpg
Copy link
Member Author

Review @jvican

Copy link
Collaborator

@jvican jvican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mostly concerned about SourceLocation being an implicit in the top logger interface of lsp4s. Otherwise LGTM!

@@ -0,0 +1,17 @@
package scala.meta.jsonrpc

class SourceLocation(val file: String, val line: Int) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic for us because when we extend it we need to implement it, and our loggers don't use source locations. Would it be possible you introduce implicit locations in an internal logger that extends the logger interface you'd expose to implementors?

@olafurpg
Copy link
Member Author

olafurpg commented Apr 27, 2018 via email

Given that lsp4s will be an external dependency, it won't be easy to
possible to add a new logging statement to quickly debug what's
happened.
@olafurpg
Copy link
Member Author

I removed SourceLocation.

It's ~200kb, usable out of the box, includes source information and
supports Scala.js (which might be useful to implement lsp4s clients)
Copy link
Member Author

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I ended up using https://github.com/outr/scribe to avoid reinventing the wheel on logging.

Copy link
Collaborator

@jvican jvican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@jvican jvican merged commit de927af into scalameta:master Apr 27, 2018
@gabro
Copy link
Member

gabro commented Apr 27, 2018

Nice, I admit I was getting concerned about accidentally re-inventing a new logging library 😅

@olafurpg
Copy link
Member Author

I had forgotten about scribe, I eliminated slf4j since I want to keep the ability to cross-build for Scala.js open (might be handy for editor clients).

@laughedelic
Copy link
Member

laughedelic commented Apr 28, 2018

I want to keep the ability to cross-build for Scala.js open (might be handy for editor clients)

I was going to ask about it! Cool 👍

@olafurpg olafurpg changed the title Remove logback, use hand-roll logger trait Replace logback with scribe Apr 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants