public class SalesforceLogger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SalesforceLogger.Level
An enumeration of log levels.
|
Modifier and Type | Method and Description |
---|---|
void |
d(java.lang.String tag,
java.lang.String message)
Logs a debug log line.
|
void |
d(java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs a debug log line.
|
void |
disableFileLogging()
Disables file logging.
|
void |
e(java.lang.String tag,
java.lang.String message)
Logs an error log line.
|
void |
e(java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs an error log line.
|
void |
enableFileLogging(int maxSize)
Enables file logging.
|
static void |
flushComponents()
Wipes all components currently being logged.
|
static java.util.Set<java.lang.String> |
getComponents()
Returns the set of components that have loggers associated with them.
|
FileLogger |
getFileLogger()
Returns the instance of FileLogger associated with this component.
|
static SalesforceLogger |
getLogger(java.lang.String componentName,
Context context)
Returns a logger instance associated with a named component.
|
SalesforceLogger.Level |
getLogLevel()
Returns the log level currently being used.
|
void |
i(java.lang.String tag,
java.lang.String message)
Logs an info log line.
|
void |
i(java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs an info log line.
|
boolean |
isFileLoggingEnabled()
Returns if file logging is enabled or not.
|
void |
log(SalesforceLogger.Level level,
java.lang.String tag,
java.lang.String message)
Logs a log line of the specified level.
|
void |
log(SalesforceLogger.Level level,
java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs a log line of the specified level.
|
static void |
resetLoggerPrefs(Context context)
Resets the stored logger prefs.
|
void |
setLogLevel(SalesforceLogger.Level level)
Sets the log level to be used.
|
void |
v(java.lang.String tag,
java.lang.String message)
Logs a verbose log line.
|
void |
v(java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs a verbose log line.
|
void |
w(java.lang.String tag,
java.lang.String message)
Logs a warning log line.
|
void |
w(java.lang.String tag,
java.lang.String message,
java.lang.Throwable e)
Logs a warning log line.
|
public static SalesforceLogger getLogger(java.lang.String componentName, Context context)
componentName
- Component name.context
- Context.public static java.util.Set<java.lang.String> getComponents()
public static void flushComponents()
public FileLogger getFileLogger()
public SalesforceLogger.Level getLogLevel()
public void setLogLevel(SalesforceLogger.Level level)
level
- Log level.public void disableFileLogging()
public void enableFileLogging(int maxSize)
maxSize
- Maximum number of log lines allowed to be stored at a time.public boolean isFileLoggingEnabled()
public void e(java.lang.String tag, java.lang.String message)
tag
- Log tag.message
- Log message.public void e(java.lang.String tag, java.lang.String message, java.lang.Throwable e)
tag
- Log tag.message
- Log message.e
- Exception to be logged.public void w(java.lang.String tag, java.lang.String message)
tag
- Log tag.message
- Log message.public void w(java.lang.String tag, java.lang.String message, java.lang.Throwable e)
tag
- Log tag.message
- Log message.e
- Exception to be logged.public void i(java.lang.String tag, java.lang.String message)
tag
- Log tag.message
- Log message.public void i(java.lang.String tag, java.lang.String message, java.lang.Throwable e)
tag
- Log tag.message
- Log message.e
- Exception to be logged.public void d(java.lang.String tag, java.lang.String message)
tag
- Log tag.message
- Log message.public void d(java.lang.String tag, java.lang.String message, java.lang.Throwable e)
tag
- Log tag.message
- Log message.e
- Exception to be logged.public void v(java.lang.String tag, java.lang.String message)
tag
- Log tag.message
- Log message.public void v(java.lang.String tag, java.lang.String message, java.lang.Throwable e)
tag
- Log tag.message
- Log message.e
- Exception to be logged.public void log(SalesforceLogger.Level level, java.lang.String tag, java.lang.String message)
level
- Log level.tag
- Log tag.message
- Log message.public void log(SalesforceLogger.Level level, java.lang.String tag, java.lang.String message, java.lang.Throwable e)
level
- Log level.tag
- Log tag.message
- Log message.e
- Exception to be logged.public static void resetLoggerPrefs(Context context)
context
- Context.