Skip to content

Commit

Permalink
Binary compat for SLF4J module
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorklang committed May 23, 2012
1 parent b9bfcaf commit 2198462
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jEventHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,29 @@ trait SLF4JLogging {
lazy val log = Logger(this.getClass.getName)
}

/**
* Logger is a factory for obtaining SLF4J-Loggers
*/
object Logger {
/**
* @param logger - which logger
* @return a Logger that corresponds for the given logger name
*/
def apply(logger: String): SLFLogger = SLFLoggerFactory getLogger logger

/**
* @param logClass - the class to log for
* @param logSource - the textual representation of the source of this log stream
* @return a Logger for the specified parameters
*/
def apply(logClass: Class[_], logSource: String): SLFLogger = logClass match {
case c if c == classOf[DummyClassForStringSources] apply(logSource)
case _ SLFLoggerFactory getLogger logClass
}

/**
* Returns the SLF4J Root Logger
*/
def root: SLFLogger = apply(SLFLogger.ROOT_LOGGER_NAME)
}

Expand Down

0 comments on commit 2198462

Please sign in to comment.