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

Support logger.error(message: String, t:Throwable) #8

Open
analytically opened this issue Nov 21, 2014 · 6 comments
Open

Support logger.error(message: String, t:Throwable) #8

analytically opened this issue Nov 21, 2014 · 6 comments

Comments

@analytically
Copy link

For easier migration from eg. Scala-Logging or SLF4J.

@sarahgerweck
Copy link
Contributor

This is an interesting suggestion. I'm not in love with having two ways of doing the same thing, so I'll have to give it some thought.

One Idea I have would be to have an extra org.log4s.compat._ interface that you can import to get access to compatibility APIs like this. I assume that would satisfy your needs well enough? I think I could make that work without adding any runtime overhead, and it would provide a way to support lots of legacy interfaces, like the template-based SLF4J interfaces in addition to the Throwable logger.

@rossabaker
Copy link
Contributor

+1 to the compat interface. That would greatly ease adoption on legacy code without polluting "The Log4s Way."

@sarahgerweck
Copy link
Contributor

All right, a compat package with some façades seems to be the way to go here. It will be just another import you can toss into your code to get additional interfaces.

I've also been planning to add support for SLF4J's Markers, so I'll probably do both of these in one shot. (Markers are the last missing feature that might change the preferred API for standard logging stuff, so it'll be a good thing to nail down before building the compatibility layers.)

I'll probably have time to get to this enhancement by the end of the year.

@larsrh
Copy link

larsrh commented Mar 2, 2017

Is marker support still planned?

@sarahgerweck
Copy link
Contributor

@larsrh I haven't heard too much interest in markers, but if you have a use case then I will take another look at how to add these in. I don't think it's difficult, I just need to consider what the API should look like and write the macros.

@larsrh
Copy link

larsrh commented Mar 2, 2017

I don't need it right away, it's just something somewhere on my to-do-list. The use case is to support different "log sections" of a system, i.e., I want to declare that "trees" and "types" should be logged in my application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants