Simple slf4j api implementation for GWT
The aim of this project is to provide developers with an implementation of the Simple Logging Facade for Java (SLF4J 1.7.30.1) API for the GWT client side. Right now the project provides the basic implementation of the SLF4J API using the java.util.logging (JUL) logging framework supported since GWT 2.1. All logging messages are printed to developer/firebug console. Note that slf4j-gwt depends on the latest stable GWT (GWT 2.8.2).
Source Fork
This project is based off of the original library at https://github.com/FinamTrade/slf4j-gwt. Their implementation had fallen behind and had an older GWT dependency. The purpose of this fork is to distribute to maven with the newer GWT 2.8.2 release.
Usage
slf4j-gwt is available in maven central
Just include it in your pom.xml
<dependency>
<groupId>com.oxos</groupId>
<artifactId>slf4j-gwt</artifactId>
<version>1.7.30</version>
</dependency>
or gradle build:
dependencies {
compile 'com.oxos:slf4j-gwt:1.7.30'
}
or ivy:
<dependency org="com.oxos" name="slf4j-gwt" rev="1.7.30" />
Add dependency in your gwt module descriptor (*.gwt.xml):
<inherits name="com.oxos.slf4jgwt.logging.gwt.Logging"/>
You can also set logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE):
<set-property name="gwt.logging.logLevel" value="INFO"/>
Enable or disable gwt logging:
<set-property name="gwt.logging.enabled" value="TRUE"/>
If you want to provide slf4j API (e.g., in library module):
<inherits name="com.oxos.slf4jgwt.api.API"/>
If you want to provide slf4j but to not log anything in your application:
<inherits name="com.oxos.slf4jgwt.logging.nop.NOP"/>
com.oxos.slf4jgwt.logging.util.Util module provides a handful Log class to log messages without instantiating Logger in client code.