Class Log


  • public final class Log
    extends Object

    Project specific logger

    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Field Detail

      • Logger

        private static final Logger Logger

        Class logger instance.

      • TAG

        private static final String TAG

        Class logger tag.

      • Max_Tag_Length

        private static final int Max_Tag_Length

        maximum tag length when android.util.Log.isLoggable is used

        See Also:
        Constant Field Values
      • Trim_Text

        private static final String Trim_Text

        remove from the beginning of the log tag. It's redundant.

        See Also:
        Constant Field Values
    • Constructor Detail

      • Log

        private Log()

        Utility class

    • Method Detail

      • format

        private static String format​(@NotNull
                                     @NotNull String msg,
                                     @Nullable
                                     @Nullable Object... args)

        formatiert eine nachricht mit parameters wenn diese gegeben sind. Sonst wird der string ungeändert zurückgeliefert.

        Parameters:
        msg - nachricht
        args - parameter für die nachricht.
        Returns:
        die formatierte nachricht.
        See Also:
        String.format(String, Object...)
      • getLogTag

        public static String getLogTag​(@NotNull
                                       @NotNull Class<?> clazz)

        creates a log Tag for the given class. It is ensured that the Log tag does not exceeds the allowed maximum of 23 characters used by android.util.Log.isLoggable

        Parameters:
        clazz - class name to create a log tag for
        Returns:
        a log tag of maximum 23 characters.
      • getLogTag

        public static String getLogTag​(@NotNull
                                       @NotNull String name)

        creates a log Tag for the given class. It is ensured that the Log tag does not exceeds the allowed maximum of 23 characters used by android.util.Log.isLoggable

        Parameters:
        name - class name to create a log tag for
        Returns:
        a log tag of maximum 23 characters.
      • getUIQ3LogTag

        public static String getUIQ3LogTag​(@NotNull
                                           @NotNull Class<?> clazz)

        creates a log Tag for the given class. It is ensured that the Log tag does not exceeds the allowed maximum of 23 characters used by android.util.Log.isLoggable

        Parameters:
        clazz - class name to create a log tag for
        Returns:
        a log tag of maximum 23 characters.
      • getUIQ3LogTag

        public static String getUIQ3LogTag​(@NotNull
                                           @NotNull String name)

        creates a log Tag for the given class. It is ensured that the Log tag does not exceeds the allowed maximum of 23 characters used by @link android.util.Log.isLoggable}

        Parameters:
        name - class name to create a log tag for
        Returns:
        a log tag of maximum 23 characters.