[slf4j-dev] [Bug 173] slf4j android: Android throws an IllegalArgumentException when Log Tag length exceeds 23 characters

bugzilla-daemon at qos.ch bugzilla-daemon at qos.ch
Tue Aug 20 14:20:22 CEST 2013


http://bugzilla.slf4j.org/show_bug.cgi?id=173

idolon <idolon.dev at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |idolon.dev at gmail.com

--- Comment #13 from idolon <idolon.dev at gmail.com> ---
Just FYI. 
I've just checked all android.util.Log methods v(), d(), i(), w() and e() on
Android 2.2 and 4.1 - neither of it throws an exception even with very long
tag. (however Eclipse LogCat view doesn't correctly display messages if
tag.length + time.length > 128 characters).

The only place where tag is checked for 23 chars length - isLoggable() method.
I've filled issue on Android bug tracker to correct this most likely obsolete
behavior: https://code.google.com/p/android/issues/detail?id=59186

test code:

        String TAG_LEN_23 = "abcdefghijklmnopqrstuvw";
        String TAG_LEN_26 = "abcdefghijklmnopqrstuvwxyz";
        String TAG_LEN_80 =
"01234567890123456789012345678901234567890123456789012345678901234567890123456789";
        String TAG_LEN_100 =
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";

        Log.i(TAG_LEN_23, "blabla");

        // no exception under both 2.2 and 4.1
        Log.i(TAG_LEN_26, "blabla");

        // no exception either
        Log.i(TAG_LEN_80, "blabla");
        Log.v(TAG_LEN_80, "blabla");
        Log.d(TAG_LEN_80, "blabla");
        Log.w(TAG_LEN_80, "blabla");
        Log.e(TAG_LEN_80, "blabla");

        // still no exception but Eclipse LogCat view will display it
incorrectly
        Log.i(TAG_LEN_100, "blabla");

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-dev/attachments/20130820/37929528/attachment.html>


More information about the slf4j-dev mailing list