[slf4j-dev] [Bug 231] New: Allow completely turning off logging for production environments
bugzilla-daemon at pixie.qos.ch
bugzilla-daemon at pixie.qos.ch
Mon Aug 8 17:31:02 CEST 2011
http://bugzilla.slf4j.org/show_bug.cgi?id=231
Summary: Allow completely turning off logging for production
environments
Product: SLF4J
Version: unspecified
Platform: Other
OS/Version: other
Status: NEW
Severity: enhancement
Priority: P1
Component: slf4j-android
AssignedTo: slf4j-dev at qos.ch
ReportedBy: thorsten.Moeller at unibas.ch
The SLF4J Android port should provide means to completely turn of logging (for
performance reasons, for production use). This issue is intended primarily for
discussing the different options for a solution.
There are at least three ways how it could be achieved:
First, by deactivating all logging related method calls when compiling an
application. Obviously, this would be tedious if done manually and should
therefore be automated by some kind of scripting and be part of the build
process.
Second, by a "null" logger implementation that can be used instead of the
standard one (which delegates to Android Log). The downside here is that
logging is not entirely deactivated since the application code is compiled
unchanged, hence, there is still (more or less) logging overhead. Also, the
question is how should we switch between the two: programmatically or
externally configurable?
A third option is to distribute two different JARs, one for debugging purposes,
another one for production use. The difference between the two JARs is that the
former contains the standard logger, while the latter contains a null logger.
This would be easily integratable in a Maven-managed build process: one can
define two profiles, say "dev" and "rel". The latter would define a dependency
using a classifier referring to the null-logger JAR whereas the former would
define a dependency to the JAR containing the default logger. However, this
approach has the same downside than the second one.
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the slf4j-dev
mailing list