public class Logger extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
APP_LOGGING
Should app tags be logged?
|
protected static String |
APPLICATION
Used for APPLICATION related logging.
|
protected static boolean |
DEBUG_ENABLED
Are we in DEBUG mode?
|
protected static boolean |
DEBUG_LOG_OVERRIDE |
protected static int |
HALF_TAG_LENGTH |
protected static boolean |
INFO_ENABLED |
protected static String[][] |
LOG_CATEGORY
All the prefixes we know how to shorten.
|
protected static int |
MAX_TAG_LENGTH |
protected String |
mCategoryTag
The tag used for this instance.
|
protected boolean |
mIsAppTag
Is this an app level tag?
Toggles printing when DEBUG_ENABLED is false;
|
protected static String |
PLATFORM
Used for PLATFORM related logging.
|
protected static String |
SDK_TAG
Used as TAG for all logging when not in Debug mode
|
Constructor and Description |
---|
Logger(Class<?> cls)
Construct a logger for the given class.
|
Logger(Class<?> cls,
String tag) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildLogString(Object... data)
Builds a string out of a number of objects.
|
protected String |
buildTag(Class<?> cls)
Builds the log tag used for this class.
|
void |
d(Object... data)
Log a number of arguments at debug level.
|
void |
d(String log)
Log a single string at debug level.
|
static String |
devices(Collection<? extends NADevice> devices) |
void |
devices(String description,
Collection<? extends NADevice> devices)
Log a list of devices with their names and addresses.
|
void |
devices(String description,
String subDescription,
Collection<? extends NADevice> devices)
Log a list of devices with their names and addresses.
|
void |
e(Object... data)
Log a number of arguments at error level.
|
void |
e(String log) |
void |
e(String log,
Throwable e) |
void |
i(Object... data)
Log a number of arguments at info level.
|
void |
i(String log)
Log a single message at info level.
|
static void |
setAppLogging(boolean appLog) |
static void |
setDebugLogging(boolean debug) |
static void |
setInfoLogging(boolean debug) |
void |
setLogEntriesEnabled(boolean enabled) |
protected boolean |
shouldDebugLog() |
protected boolean |
shouldInfoLog(int level) |
boolean |
shouldLogtoLogEntries() |
void |
w(Object... data)
Log a number of arguments at warn level.
|
void |
w(String log) |
protected static final int HALF_TAG_LENGTH
protected static boolean DEBUG_LOG_OVERRIDE
protected static final int MAX_TAG_LENGTH
protected static final String SDK_TAG
protected static final String PLATFORM
protected static final String APPLICATION
protected static final boolean DEBUG_ENABLED
protected static boolean INFO_ENABLED
protected final String mCategoryTag
protected boolean mIsAppTag
protected static boolean APP_LOGGING
protected static final String[][] LOG_CATEGORY
public Logger(Class<?> cls)
cls
- The class we will be logging for.public static void setDebugLogging(boolean debug)
public static void setInfoLogging(boolean debug)
public static void setAppLogging(boolean appLog)
protected String buildTag(Class<?> cls)
cls
- The class to build a tag for.protected boolean shouldInfoLog(int level)
protected boolean shouldDebugLog()
public boolean shouldLogtoLogEntries()
public void setLogEntriesEnabled(boolean enabled)
public void d(String log)
log
- the message to log.public void d(Object... data)
data
- the objects to combine into one string and then log.public void i(String log)
log
- the message to log.public void i(Object... data)
data
- the objects to combine into one string and then log.public void w(String log)
public void w(Object... data)
data
- the objects to combine into one string and then log.public void e(String log)
public void e(Object... data)
data
- the objects to combine into one string and then log.public void devices(String description, String subDescription, Collection<? extends NADevice> devices)
description
- a description of these devices.subDescription
- a sub descripition of these devices.devices
- the List of devices.public static String devices(Collection<? extends NADevice> devices)
public void devices(String description, Collection<? extends NADevice> devices)
description
- a description of these devices.devices
- the List of devices.