diff --git a/slf4j-android/src/main/java/org/slf4j/impl/AndroidLoggerAdapter.java b/slf4j-android/src/main/java/org/slf4j/impl/AndroidLoggerAdapter.java index e88cfc89..9472aaa2 100755 --- a/slf4j-android/src/main/java/org/slf4j/impl/AndroidLoggerAdapter.java +++ b/slf4j-android/src/main/java/org/slf4j/impl/AndroidLoggerAdapter.java @@ -30,15 +30,15 @@ import org.slf4j.helpers.MarkerIgnoringBase; import org.slf4j.helpers.MessageFormatter; /** - * A simple implementation that delegates all log requests to the Google Android + *
A simple implementation that delegates all log requests to the Google Android * logging facilities. Note that this logger does not support {@link org.slf4j.Marker}. * Methods taking marker data as parameter simply invoke the eponymous method - * without the Marker argument, discarding any marker data in the process. - *
- * The logging levels specified for SLF4J can be almost directly mapped to + * without the Marker argument, discarding any marker data in the process. + * + *The logging levels specified for SLF4J can be almost directly mapped to * the levels that exist in the Google Android platform. The following table - * shows the mapping implemented by this logger. - *
+ * shows the mapping implemented by this logger. + * *| SLF4J | Android |
|---|---|
| TRACE | {@link android.util.Log#VERBOSE} |
| ERROR | {@link android.util.Log#ERROR} |
Use loggers as usual: + *
private static final Logger logger = LoggerFactory.getLogger(MyClass.class);
+ * logger.debug("Some log message. Details: {}", someObject);logger.debug("Some log message with varargs. Details: {}, {}, {}", someObject1, someObject2, someObject3);
+ * Logger instances created using the LoggerFactory are named either according to the name + * or the fully qualified class name of the class given as a parameter. + * Each logger name will be used as the log message tag on the Android platform. + * However, tag names cannot be longer than 23 characters so if logger name exceeds this limit then + * it will be truncated by the LoggerFactory. The following examples illustrate this. + *
| Original Name | Truncated Name |
|---|---|
| org.example.myproject.mypackage.MyClass | o*.e*.m*.m*.MyClass |
| o.e.myproject.mypackage.MyClass | o.e.m*.m*.MyClass |
| org.example.ThisNameIsWayTooLongAndWillBeTruncated | *LongAndWillBeTruncated |
| ThisNameIsWayTooLongAndWillBeTruncated | *LongAndWillBeTruncated |