Simple Scala facade for SLF4J
See the codeh1. SLF4S
SLF4S (Simple Logging Facade for Scala) is a thin "Scala":http://www.scala-lang.org wrapper around "SLF4J":http://www.slf4j.org offering the following features:
* _Logging_ trait to easily mix in a _Logger_ initialized with the class name
* By-name parameters on log methods for better performance
* OSGi compliant
SLF4S is open source software licensed under the "Apache 2.0 License":http://www.apache.org/licenses/LICENSE-2.0.html. Just use it!
h2. Getting SLF4S
The binaries are made available in the "Scala-Tools.org Maven repository":http://scala-tools.org/repo-releases/com/weiglewilczek/slf4s/.
h3. For SBT
<pre><code>val slf4s = "com.weiglewilczek.slf4s" %% "slf4s" % "1.0.7</code></pre>
Supported Scala versions are 2.8.0, 2.8.1, 2.9.0-1 and 2.9.1.
h3. For Maven
<pre><code><dependency>
<groupId>com.weiglewilczek.slf4s</groupId>
<artifactId>slf4s_2.9.1</artifactId>
<version>1.0.7</version>
</dependency></code></pre>
Replace the suffix of the artifactId to represent one of the supported Scala versions (see above).
h2. Using SLF4S
Mix in _Logging_ trait:
<pre><code>class MyClazz extends SomeClazz with Logging</code></pre>
Or create a _Logger_ explicitly:
<pre><code>val logger = Logger("SomeSpecialName")</code></pre>
When logging something, the argument will only be evaluated if the according log level is enabled:
<pre><code>logger.info("Created customer with id " + id)</code></pre>
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Scala
100.0%
Simple Scala facade for SLF4J
See the codeh1. SLF4S
SLF4S (Simple Logging Facade for Scala) is a thin "Scala":http://www.scala-lang.org wrapper around "SLF4J":http://www.slf4j.org offering the following features:
* _Logging_ trait to easily mix in a _Logger_ initialized with the class name
* By-name parameters on log methods for better performance
* OSGi compliant
SLF4S is open source software licensed under the "Apache 2.0 License":http://www.apache.org/licenses/LICENSE-2.0.html. Just use it!
h2. Getting SLF4S
The binaries are made available in the "Scala-Tools.org Maven repository":http://scala-tools.org/repo-releases/com/weiglewilczek/slf4s/.
h3. For SBT
<pre><code>val slf4s = "com.weiglewilczek.slf4s" %% "slf4s" % "1.0.7</code></pre>
Supported Scala versions are 2.8.0, 2.8.1, 2.9.0-1 and 2.9.1.
h3. For Maven
<pre><code><dependency>
<groupId>com.weiglewilczek.slf4s</groupId>
<artifactId>slf4s_2.9.1</artifactId>
<version>1.0.7</version>
</dependency></code></pre>
Replace the suffix of the artifactId to represent one of the supported Scala versions (see above).
h2. Using SLF4S
Mix in _Logging_ trait:
<pre><code>class MyClazz extends SomeClazz with Logging</code></pre>
Or create a _Logger_ explicitly:
<pre><code>val logger = Logger("SomeSpecialName")</code></pre>
When logging something, the argument will only be evaluated if the according log level is enabled:
<pre><code>logger.info("Created customer with id " + id)</code></pre>
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Scala
100.0%