abstract class UDPLoggingService extends ServiceImpl implements CrashReportingService, LoggingService
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
host
Host portion of
url |
private int |
port
Port portion of
url |
private java.lang.String |
url
UDP logging URL (eg: logs.myserver.com:12345)
|
context, utils| Constructor and Description |
|---|
UDPLoggingService(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
enable(java.lang.String url)
Enable this service.
|
protected java.lang.String |
getSysLogFormattedDate()
syslog style date formatter
|
boolean |
isEnabled()
This service is enabled
|
void |
logEvent(StoredException storedException,
retrofit.Callback<java.lang.Object> callback)
Send stored exception (i.e., crashes) to UDP endpoint
|
void |
logEvent(java.lang.String log)
Send individual log messages (i.e., Log.e() calls) to UDP endpoint
|
protected void |
sendDataOverUDP(java.lang.String syslogMessage,
retrofit.Callback<java.lang.Object> deleteFileCallback)
Attempt to send syslog-style message over UDP using a DatagramSocket.
|
protected void |
sendLogEvent(java.lang.String component,
java.lang.String message,
retrofit.Callback<java.lang.Object> callback)
Create properly formatted message to send over UDP that acts like a syslog message
syslog format: "<priority>timestamp orange_link blue_link: message"
Details: http://en.wikipedia.org/wiki/Syslog#Priority
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceTypeprivate java.lang.String url
private java.lang.String host
urlprivate int port
urlpublic void enable(java.lang.String url)
public boolean isEnabled()
public void logEvent(StoredException storedException, retrofit.Callback<java.lang.Object> callback)
logEvent in interface CrashReportingServicelogEvent in interface LoggingServicestoredException - StoredException data. Never null.callback - Retrofit callback. Use NoOpCallback if no
action is required.public void logEvent(java.lang.String log)
logEvent in interface LoggingServicelog - Log message to send.protected void sendLogEvent(java.lang.String component,
java.lang.String message,
retrofit.Callback<java.lang.Object> callback)
component - Component (eg, Thread name)message - Message to sendcallback - Callback to execute after data is sent. Can be null. Will only be
executed if the data is successfully sent.protected java.lang.String getSysLogFormattedDate()
protected void sendDataOverUDP(java.lang.String syslogMessage,
retrofit.Callback<java.lang.Object> deleteFileCallback)
syslogMessage - Message to senddeleteFileCallback - Retrofit Callback. After data is sent this Callback is executed
to delete the file that contained the data that was sent.