|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.utils.LogUtils
public final class LogUtils
Logging utility functions: Allows logging to be enabled, Logs application name and current thread name prepended to logged data.
Field Summary | |
---|---|
private static java.lang.String |
APP_FILE_NAME
SD Card filename. |
private static java.lang.String |
APP_NAME_PREFIX
Application tag prefix for LogCat. |
private static java.text.SimpleDateFormat |
DATE_FORMAT
Simple date format for Logging. |
private static int |
LOG_FILE_COUNT
Maximum number of SD Card log files. |
private static int |
LOG_FILE_LIMIT
SD Card log file size limit (in bytes). |
private static java.lang.Boolean |
mEnabled
Stores the enabled state of the LogUtils function. |
private static java.util.logging.Logger |
sLogger
SD Card data logger. |
Constructor Summary | |
---|---|
private |
LogUtils()
Private constructor makes it impossible to create an instance of this utility class. |
Method Summary | |
---|---|
static void |
enableLogcat()
Enable logging. |
static java.lang.Boolean |
isEnabled()
Returns if the logging feature is currently enabled. |
static void |
logD(java.lang.String data)
Write debug log string. |
static void |
logE(java.lang.String data)
Write error log string. |
static void |
logE(java.lang.String data,
java.lang.Throwable exception)
Write error log string with Exception thrown. |
static void |
logI(java.lang.String data)
Write info log string. |
static void |
logToFile(byte[] data,
java.lang.String fileName)
Writes a given byte-array to the SD card under the given file name. |
static void |
logToFile(java.lang.String data)
Write a line to the SD Card log file (e.g. |
static void |
logV(java.lang.String data)
Write verbose log string. |
static void |
logW(java.lang.String data)
Write warning log string. |
static void |
logWithName(java.lang.String name,
java.lang.String data)
Write info log string with specific component name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String APP_NAME_PREFIX
private static final java.text.SimpleDateFormat DATE_FORMAT
private static final java.lang.String APP_FILE_NAME
private static final int LOG_FILE_LIMIT
private static final int LOG_FILE_COUNT
private static java.lang.Boolean mEnabled
private static java.util.logging.Logger sLogger
Constructor Detail |
---|
private LogUtils()
Method Detail |
---|
public static void enableLogcat()
public static void logI(java.lang.String data)
data
- String containing data to be logged.public static void logD(java.lang.String data)
data
- String containing data to be logged.public static void logW(java.lang.String data)
data
- String containing data to be logged.public static void logE(java.lang.String data)
data
- String containing data to be logged.public static void logV(java.lang.String data)
data
- String containing data to be logged.public static void logWithName(java.lang.String name, java.lang.String data)
name
- String name string to prepend to log data.data
- String containing data to be logged.public static void logE(java.lang.String data, java.lang.Throwable exception)
data
- String containing data to be logged.exception
- Exception associated with error.public static void logToFile(java.lang.String data)
data
- String containing data to be logged.public static void logToFile(byte[] data, java.lang.String fileName)
data
- The data to write to the SD card.fileName
- The file name to write the data under.public static java.lang.Boolean isEnabled()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc