org.appcelerator.kroll.common
Class Log

java.lang.Object
  extended by org.appcelerator.kroll.common.Log

public class Log
extends Object

API to send log output. Supported severity-levels include: 'debug', 'warn', 'info' and 'error'. Refer to Android Log documentation for more information.


Field Summary
static String DEBUG_MODE
          A constant for debug mode.
static String RELEASE_MODE
          A constant for the release mode.
 
Method Summary
static int d(String tag, String msg)
          Sends a 'debug' log message, with the thread name and time stamp pre-appended.
static int d(String tag, String msg, String mode)
          Sends a 'debug' log message, with the thread name and time stamp pre-appended.
static int d(String tag, String msg, Throwable t)
          Sends a 'debug' log message, with the thread name and time stamp pre-appended, and log the exception.
static int d(String tag, String msg, Throwable t, String mode)
          Sends a 'debug' log message, with the thread name and time stamp pre-appended, and log the exception.
static int e(String tag, String msg)
          Sends a 'error' log message, with the thread name and time stamp pre-appended.
static int e(String tag, String msg, String mode)
          Sends a 'error' log message, with the thread name and time stamp pre-appended.
static int e(String tag, String msg, Throwable t)
          Sends a 'error' log message, with the thread name and time stamp pre-appended, and log the exception For more information regarding formatting, refer to w(String, String).
static int e(String tag, String msg, Throwable t, String mode)
          Sends a 'error' log message, with the thread name and time stamp pre-appended, and log the exception For more information regarding formatting, refer to w(String, String).
static int i(String tag, String msg)
          Sends a 'info' log message, with the thread name and time stamp pre-appended.
static int i(String tag, String msg, String mode)
          Sends a 'info' log message, with the thread name and time stamp pre-appended.
static int i(String tag, String msg, Throwable t)
          Sends a 'info' log message, with the thread name and time stamp pre-appended, and log the exception.
static int i(String tag, String msg, Throwable t, String mode)
          Sends a 'info' log message, with the thread name and time stamp pre-appended, and log the exception.
static int v(String tag, String msg)
          Sends a 'verbose' log message, with the thread name and time stamp pre-appended.
static int v(String tag, String msg, String mode)
          Sends a 'verbose' log message, with the thread name and time stamp pre-appended.
static int v(String tag, String msg, Throwable t)
          Sends a 'verbose' log message, with the thread name and time stamp pre-appended, and log the exception.
static int v(String tag, String msg, Throwable t, String mode)
          Sends a 'verbose' log message, with the thread name and time stamp pre-appended, and log the exception.
static int w(String tag, String msg)
          Sends a 'warn' log message, with the thread name and time stamp pre-appended.
static int w(String tag, String msg, String mode)
          Sends a 'warn' log message, with the thread name and time stamp pre-appended.
static int w(String tag, String msg, Throwable t)
          Sends a 'warn' log message, with the thread name and time stamp pre-appended, and log the exception.
static int w(String tag, String msg, Throwable t, String mode)
          Sends a 'warn' log message, with the thread name and time stamp pre-appended, and log the exception.
 

Field Detail

RELEASE_MODE

public static final String RELEASE_MODE
A constant for the release mode. In this mode, logs are always processed. This is the default mode if none are specified.

See Also:
Constant Field Values

DEBUG_MODE

public static final String DEBUG_MODE
A constant for debug mode. In this mode, logs are only processed when TiConfig.DEBUG is true. (TiConfig.DEBUG corresponds to the 'ti.android.debug' property set by the user)

See Also:
Constant Field Values
Method Detail

v

public static int v(String tag,
                    String msg,
                    String mode)
Sends a 'verbose' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

v

public static int v(String tag,
                    String msg)
Sends a 'verbose' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

v

public static int v(String tag,
                    String msg,
                    Throwable t,
                    String mode)
Sends a 'verbose' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
t - the exception to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

v

public static int v(String tag,
                    String msg,
                    Throwable t)
Sends a 'verbose' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
t - the exception to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

d

public static int d(String tag,
                    String msg,
                    String mode)
Sends a 'debug' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

d

public static int d(String tag,
                    String msg)
Sends a 'debug' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

d

public static int d(String tag,
                    String msg,
                    Throwable t,
                    String mode)
Sends a 'debug' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
t - the exception to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

d

public static int d(String tag,
                    String msg,
                    Throwable t)
Sends a 'debug' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
t - the exception to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

i

public static int i(String tag,
                    String msg,
                    String mode)
Sends a 'info' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

i

public static int i(String tag,
                    String msg)
Sends a 'info' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

i

public static int i(String tag,
                    String msg,
                    Throwable t,
                    String mode)
Sends a 'info' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to idenfity the source of the message.
msg - the message to log.
t - the exception to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

i

public static int i(String tag,
                    String msg,
                    Throwable t)
Sends a 'info' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to idenfity the source of the message.
msg - the message to log.
t - the exception to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

w

public static int w(String tag,
                    String msg,
                    String mode)
Sends a 'warn' log message, with the thread name and time stamp pre-appended. For example, "(main) [298, 474] hello" --> "(thread-name) [elapsed time, total time] msg". This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

w

public static int w(String tag,
                    String msg)
Sends a 'warn' log message, with the thread name and time stamp pre-appended. For example, "(main) [298, 474] hello" --> "(thread-name) [elapsed time, total time] msg". This method is thread safe.

Parameters:
tag - used to identify the source of the message.
msg - the message to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

w

public static int w(String tag,
                    String msg,
                    Throwable t,
                    String mode)
Sends a 'warn' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
t - an exception to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

w

public static int w(String tag,
                    String msg,
                    Throwable t)
Sends a 'warn' log message, with the thread name and time stamp pre-appended, and log the exception. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
t - an exception to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

e

public static int e(String tag,
                    String msg,
                    String mode)
Sends a 'error' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

e

public static int e(String tag,
                    String msg)
Sends a 'error' log message, with the thread name and time stamp pre-appended. For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

e

public static int e(String tag,
                    String msg,
                    Throwable t,
                    String mode)
Sends a 'error' log message, with the thread name and time stamp pre-appended, and log the exception For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
t - the exception to log.
mode - the mode to determine whether the log should be processed
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.

e

public static int e(String tag,
                    String msg,
                    Throwable t)
Sends a 'error' log message, with the thread name and time stamp pre-appended, and log the exception For more information regarding formatting, refer to w(String, String). This method is thread safe.

Parameters:
tag - used to identify the source of message.
msg - the message to log.
t - the exception to log.
Returns:
an integer that is dependent on the content and tag of the log. Two different msgs would have two different return values.


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0