quiet-slf4j


License

License

Categories

Categories

SLF4J Application Layer Libs Logging
GroupId

GroupId

com.dadrox
ArtifactId

ArtifactId

quiet-slf4j
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

jar
Description

Description

quiet-slf4j
quiet-slf4j
Project URL

Project URL

https://github.com/dadrox/quiet-slf4j
Project Organization

Project Organization

com.dadrox
Source Code Management

Source Code Management

https://github.com/dadrox/quiet-slf4j

Download quiet-slf4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.dadrox/quiet-slf4j/ -->
<dependency>
    <groupId>com.dadrox</groupId>
    <artifactId>quiet-slf4j</artifactId>
    <version>0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.dadrox/quiet-slf4j/
implementation 'com.dadrox:quiet-slf4j:0.1'
// https://jarcasting.com/artifacts/com.dadrox/quiet-slf4j/
implementation ("com.dadrox:quiet-slf4j:0.1")
'com.dadrox:quiet-slf4j:jar:0.1'
<dependency org="com.dadrox" name="quiet-slf4j" rev="0.1">
  <artifact name="quiet-slf4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.dadrox', module='quiet-slf4j', version='0.1')
)
libraryDependencies += "com.dadrox" % "quiet-slf4j" % "0.1"
[com.dadrox/quiet-slf4j "0.1"]

Dependencies

provided (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.0

test (2)

Group / Artifact Type Version
junit : junit-dep jar 4.10
com.dadrox : sbt-junit jar 0.2

Project Modules

There are no modules declared in this project.

Quiet slf4j

An slf4j logger that, by default, logs nothing.

This is intended to suppress log output during testing.

It is written in Java, so should be usable almost anywhere.

Usage

In order for this to really work, you need to set all of your other slf4 log binders to no be available during test.

Dependency

SBT

build.sbt

libraryDependencies ++= Seq(
    "org.slf4j" % "slf4j-api" % "1.7.0",
    "com.dadrox" % "quiet-slf4j" % "0.1" % "test")

This way you get the quiet logger while running tests and the real logger in every other context.

Configuration

To enable more logging than none, use the system property log.level and give it the desired log level:

off, trace, debug, info, warn. error, or all

You can also just use the first letter or fragment of the level (case insensitive) in the system property.

Examples

> mvn -Dlog.level=debug test

> sbt -Dlog.level=e test

Yes, it really is that easy!

License

Copyright (C) 2012-2013, Christopher Wood (dadrox)

Published under BSD 2-Clause License

Versions

Version
0.1