Open
Conversation
Use symlinks to have AbstractLogger be identical between the log4j and the slf4j versions. Due to macro restrictions, the methods in AbstractLogger have to be non-abstract otherwise one cannot define a macro: [error] scalalogging-log4j/src/main/scala/com/typesafe/scalalogging/log4j/Logger.scala:46: overriding method fatal in trait AbstractLogger of type (message: String)Unit; [error] macro method fatal cannot override an abstract method [error] override def fatal(message: String): Unit = macro LoggerMacros.fatalMessage [error] ^
|
@blair, this is cool stuff, yet I think we need to further restructure and refactor the whole project, i.e. this is something for a 2.0 release. |
Author
|
OK. You could merge in the first commit, the one that adds the 'override'. |
Heiko |
Author
|
Adding 'override' is good self-documentation. When looking at class in vi or emacs, I like to know if the method is a method in that class or overrides a method from a super-class or super-trait without having to look at the other source files. http://stackoverflow.com/questions/94361/when-do-you-use-javas-override-annotation-and-why |
|
Sure, 100% agreed. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch moves AbstractLogging from com.typesafe.scalalogging.{log4j,slf4j}.AbstractLogging up a level to com.typesafe.scalalogging.AbstractLogging. This allows one to abstract over the logging implementation.
Since AbstractLogging returns a logger, I needed to unify the log4j and sl4fj loggers so added AbstractLogger. Due to restrictions in Scala 2.10 macros, I needed to define the AbstractLogger methods to have the macros work.