Class Log


  • public final class Log
    extends Object
    Couchbase Lite Internal Log Utility.

    Log levels are as follows: e: internal errors that are unrecoverable w: internal errors that are recoverable; client errors that may not be recoverable i: essential state info and client errors that are probably recoverable v: used by core: please do not use in platform coded. d: low-level debugging information

    • Method Detail

      • initLogging

        public static void initLogging​(@NonNull
                                       Map<String,​String> errorMessages)
        Setup logging.
      • initLogging

        public static void initLogging()
      • d

        public static void d​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg)
        Send a DEBUG message.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
      • d

        public static void d​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err)
        Send a DEBUG message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
        err - An exception to log
      • d

        public static void d​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             Object... args)
        Send a DEBUG message.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        args - Variable number of Object args to be used as params to formatString.
      • d

        public static void d​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err,
                             Object... args)
        Send a DEBUG message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        err - An exception to log
        args - Variable number of Object args to be used as params to formatString.
      • v

        public static void v​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg)
        Send a VERBOSE message. Please do not use verbose level logging
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
      • v

        public static void v​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err)
        Send a VERBOSE message and log the exception. Please do not use verbose level logging
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
        err - An exception to log
      • v

        public static void v​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             Object... args)
        Send a VERBOSE message. Please do not use verbose level logging
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        args - Variable number of Object args to be used as params to formatString.
      • v

        public static void v​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err,
                             Object... args)
        Send a VERBOSE message and log the exception. Please do not use verbose level logging
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        err - An exception to log
        args - Variable number of Object args to be used as params to formatString.
      • i

        public static void i​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg)
        Send an INFO message.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
      • info

        public static void info​(@NonNull
                                LogDomain domain,
                                @NonNull
                                String msg)
      • i

        public static void i​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err)
        Send a INFO message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
        err - An exception to log
      • i

        public static void i​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             Object... args)
        Send an INFO message.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        args - Variable number of Object args to be used as params to formatString.
      • i

        public static void i​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err,
                             Object... args)
        Send a INFO message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        err - An exception to log
        args - Variable number of Object args to be used as params to formatString.
      • w

        public static void w​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg)
        Send a WARN message.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
      • w

        public static void w​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err)
        Send a WARN message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
        err - An exception to log
      • w

        public static void w​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             Object... args)
        Send a WARN message.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        args - Variable number of Object args to be used as params to formatString.
      • w

        public static void w​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err,
                             Object... args)
        Send a WARN message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        err - An exception to log
        args - Variable number of Object args to be used as params to formatString.
      • e

        public static void e​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg)
        Send an ERROR message.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
      • e

        public static void e​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err)
        Send a ERROR message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The message you would like logged.
        err - An exception to log
      • e

        public static void e​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             Object... args)
        Send a ERROR message.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        args - Variable number of Object args to be used as params to formatString.
      • e

        public static void e​(@NonNull
                             LogDomain domain,
                             @NonNull
                             String msg,
                             @Nullable
                             Throwable err,
                             Object... args)
        Send a ERROR message and log the exception.
        Parameters:
        domain - The log domain.
        msg - The string you would like logged plus format specifiers.
        err - An exception to log
        args - Variable number of Object args to be used as params to formatString.
      • lookupStandardMessage

        @NonNull
        public static String lookupStandardMessage​(@Nullable
                                                   String msg)
      • formatStandardMessage

        @NonNull
        public static String formatStandardMessage​(@Nullable
                                                   String msg,
                                                   @NonNull
                                                   Object... args)
      • getLogLevelForC4Level

        @NonNull
        public static LogLevel getLogLevelForC4Level​(int c4Level)
      • getC4LevelForLogLevel

        public static int getC4LevelForLogLevel​(@NonNull
                                                LogLevel logLevel)
      • getC4DomainForLoggingDomain

        @NonNull
        public static String getC4DomainForLoggingDomain​(@NonNull
                                                         LogDomain domain)
      • getLoggingDomainForC4Domain

        @NonNull
        public static LogDomain getLoggingDomainForC4Domain​(@NonNull
                                                            String c4Domain)
      • warn

        public static void warn()