Modifier and Type | Method and Description |
---|---|
static void |
setInterceptor(boolean flag)
Sets whether the API runs in interceptor mode or not.
|
static void |
setTarget(File file)
A shorthand for
setTarget(File, boolean) in overwritten mode. |
static void |
setTarget(File file,
boolean append)
Sets the target of the log messages to a local file.
|
static void |
setTarget(int priority,
String tag)
Sets the target of the log messages to the system log (LogCat).
|
static void |
setTarget(SocketAddress sockAddr)
Sets the target of the log messages to a network UDP server.
|
static void |
setTarget(String host,
int port)
Sets the target of the log messages to a network UDP server.
|
public static void setInterceptor(boolean flag)
When the mode is activated, the output of the calls to the API is directed to the target
defined by a setTarget()
.
Otherwise, calls are simply forwarded to the native implementation.
Note that it remains the case, as a fallback, if no target is defined.
flag
- true
to activate the mode.public static void setTarget(File file) throws IOException
setTarget(File, boolean)
in overwritten mode.file
- The file to receive the log messages.IOException
- If the file cannot be opened for writing.setTarget(File, boolean)
public static void setTarget(File file, boolean append) throws IOException
Example: setTarget(new File(Environment.getExternalStorageDirectory(), "traces.log"), true)
file
- The file to receive the log messages.append
- Indicates whether or not to append to an existing file.IOException
- If the file cannot be opened for writing.setTarget(File)
public static void setTarget(String host, int port)
Example: setTarget("host.domain.com", 9696)
Example: setTarget("192.168.0.10", 9696)
host
- The hostname of the server.port
- The port number of the server.setTarget(SocketAddress)
public static void setTarget(SocketAddress sockAddr)
sockAddr
- The target host address and port.setTarget(String, int)
public static void setTarget(int priority, String tag)
Example: setTarget(android.util.Log.DEBUG, "MyTag")
priority
- The priority/type for the log message.tag
- The tag for the log message.