public class

Log

extends Object
java.lang.Object
   ↳ com.tencent.wcdb.support.Log

Class Overview

API for WCDB log redirection.

Typically, applications call setLogger(int) or setLogger(LogCallback) to setup logger callback, WCDB library itself uses the rest methods to send log outputs to the preset or user defined logger.

Summary

Nested Classes
interface Log.LogCallback User defined logger interface. 
Constants
int LOGGER_DEFAULT Default logger which output logs to Android system log (logcat).
int LOGGER_NONE Preset No-op logger which drops all log outputs.
Public Methods
static void d(String tag, String msg)
Send a DEBUG log message.
static void d(String tag, String format, Object... args)
Send a DEBUG log message with string formatter.
static void e(String tag, String format, Object... args)
Send an ERROR log message with string formatter.
static void e(String tag, String msg)
Send an ERROR log message.
static void f(String tag, String msg)
Send a FATAL log message.
static void f(String tag, String format, Object... args)
Send a FATAL log message with string formatter.
static void i(String tag, String format, Object... args)
Send an INFO log message with string formatter.
static void i(String tag, String msg)
Send an INFO log message.
static void println(int priority, String tag, String msg)
Low-level logging call.
static void setLogger(int logger)
Use preset logger for log outputs.
static void setLogger(Log.LogCallback callback)
Use user defined logger for log outputs.
static void v(String tag, String msg)
Send a VERBOSE log message.
static void v(String tag, String format, Object... args)
Send a VERBOSE log message with string formatter.
static void w(String tag, String format, Object... args)
Send a WARN log message with string formatter.
static void w(String tag, String msg)
Send a WARN log message.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int LOGGER_DEFAULT

Default logger which output logs to Android system log (logcat). Pass it to setLogger(int).

Constant Value: 1 (0x00000001)

public static final int LOGGER_NONE

Preset No-op logger which drops all log outputs. Pass it to setLogger(int).

Constant Value: 0 (0x00000000)

Public Methods

public static void d (String tag, String msg)

Send a DEBUG log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content

public static void d (String tag, String format, Object... args)

Send a DEBUG log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void e (String tag, String format, Object... args)

Send an ERROR log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void e (String tag, String msg)

Send an ERROR log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content

public static void f (String tag, String msg)

Send a FATAL log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content

public static void f (String tag, String format, Object... args)

Send a FATAL log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void i (String tag, String format, Object... args)

Send an INFO log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void i (String tag, String msg)

Send an INFO log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content

public static void println (int priority, String tag, String msg)

Low-level logging call. Typically called by WCDB library itself.

Parameters
priority the priority of this log message. Use constants in Android logging API, android.util.Log
tag tag of this log message
msg message content

public static void setLogger (int logger)

Use preset logger for log outputs.

Parameters
logger preset logger, valid values are
  1. LOGGER_NONE
  2. LOGGER_DEFAULT

public static void setLogger (Log.LogCallback callback)

Use user defined logger for log outputs.

Parameters
callback logger callback

public static void v (String tag, String msg)

Send a VERBOSE log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content

public static void v (String tag, String format, Object... args)

Send a VERBOSE log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void w (String tag, String format, Object... args)

Send a WARN log message with string formatter. Typically called by WCDB library itself.

Parameters
tag tag of this log message
format message content
args format arguments

public static void w (String tag, String msg)

Send a WARN log message. Typically called by WCDB library itself.

Parameters
tag tag of this log message
msg message content