On Thu, Feb 24, 2011 at 1:02 AM, Thorsten Möller <<a href="mailto:thorsten.moeller@unibas.ch">thorsten.moeller@unibas.ch</a>> wrote:<br>><br>> Am 24.02.2011 um 01:38 schrieb Fred:<br>><br>>> Am I just blind?<br>
>> How do you set up filters with the android implementation of slf4j?<br>><br>> As the name "simple logging facade" indicates, neither SLF4J (in general) nor its Android implementation do provide measures for filtering logging requests - they are a facade to the underlying logging framework. Consequently, this is a feature that has to be supported underlying logging framework. The Android implementation is a facade to the logging framework of the Android platform, which has simple log level threshold based filtering, configurable directly in the Eclipse view.<br>
><br>> -Thorsten<br><br>Although slf4j doesn't necessarily provide measures for filtering logging requests it seems like that would be part of the implementation.<br>To that end I have been looking into how such behavior could be added to the implementation.<br>
The first thing I noticed is that the android logging framework has some oddities.<br>1) not really disabling logging.<br>When the /data/local.prop file (or setprop) has changed the level for a logger that has no effect on the Log.<level>() but rather on the corresponding isLoggable().<div>
To accommodating this in AndroidLogger.java I made the following modification.<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
public void trace(final String msg)<br>{<br></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
if (!Log.isLoggable(name, Log.VERBOSE)) return;</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
Log.v(name, msg);</blockquote></blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
}</blockquote><br><br></div>