Base class for all logging provider implementations. More...
Public Member Functions | |
fm.liveswitch.IFunction1< fm.liveswitch.LogEvent, Boolean > | getFilter () |
Gets a filter on the log provider. More... | |
fm.liveswitch.LogLevel | getLevel () |
Gets the log level. More... | |
void | log (fm.liveswitch.LogEvent logEvent) |
Log a message. More... | |
LogProvider () | |
Initializes a new instance of the fm.liveswitch.LogProvider class using fm.liveswitch.Log#getDefaultLogLevel as the log level. More... | |
void | setFilter (fm.liveswitch.IFunction1< fm.liveswitch.LogEvent, Boolean > value) |
Sets a filter on the log provider. More... | |
void | setLevel (fm.liveswitch.LogLevel value) |
Sets the log level. More... | |
Static Public Member Functions | |
static String | getLogLevelString (fm.liveswitch.LogLevel level) |
Converts a log-level to a 5-character string for consistently-spaced character sequences. More... | |
static String | getPrefixTimestamp (java.util.Date timestamp) |
Converts a timestamp to an ISO-8601-formatted string for rendering in a log message (YYYY-MM-DDThh:mm:ss.sssZ). More... | |
static String | getProduct () |
Returns the name of the current product. More... | |
Protected Member Functions | |
abstract void | doLog (fm.liveswitch.LogEvent logEvent) |
Logs a message at the specified log level. More... | |
String | generateLogLine (fm.liveswitch.LogEvent logEvent) |
Generates a default log line. More... | |
String | getPrefix (fm.liveswitch.LogLevel level, boolean includeTimestamp) |
Converts a log-level to a 5-character string for consistently-spaced character sequences. More... | |
int | getProcessId () |
Gets the current process id. More... | |
Base class for all logging provider implementations.
fm.liveswitch.LogProvider.LogProvider | ( | ) |
Initializes a new instance of the fm.liveswitch.LogProvider class using fm.liveswitch.Log#getDefaultLogLevel as the log level.
Reimplemented in fm.liveswitch.java.LogProvider, and fm.liveswitch.android.LogProvider.
|
abstractprotected |
Logs a message at the specified log level.
logEvent | The log event details. |
Reimplemented in fm.liveswitch.TextLogProvider, fm.liveswitch.NullLogProvider, fm.liveswitch.LogStashLogProvider, and fm.liveswitch.LogEventLogProvider.
|
protected |
Generates a default log line.
logEvent | The log event details. |
fm.liveswitch.IFunction1<fm.liveswitch.LogEvent,Boolean> fm.liveswitch.LogProvider.getFilter | ( | ) |
Gets a filter on the log provider.
Returning
will log the event, while returning
will skip it.
fm.liveswitch.LogLevel fm.liveswitch.LogProvider.getLevel | ( | ) |
Gets the log level.
|
static |
Converts a log-level to a 5-character string for consistently-spaced character sequences.
level | The log level. |
|
protected |
Converts a log-level to a 5-character string for consistently-spaced character sequences.
level | The log level. |
includeTimestamp | Whether to include a timestamp in the prefix. |
|
static |
Converts a timestamp to an ISO-8601-formatted string for rendering in a log message (YYYY-MM-DDThh:mm:ss.sssZ).
timestamp | The timestamp. |
|
protected |
Gets the current process id.
|
static |
Returns the name of the current product.
void fm.liveswitch.LogProvider.log | ( | fm.liveswitch.LogEvent | logEvent | ) |
Log a message.
logEvent | The log event details. |
void fm.liveswitch.LogProvider.setFilter | ( | fm.liveswitch.IFunction1< fm.liveswitch.LogEvent, Boolean > | value | ) |
Sets a filter on the log provider.
Returning
will log the event, while returning
will skip it.
void fm.liveswitch.LogProvider.setLevel | ( | fm.liveswitch.LogLevel | value | ) |
Sets the log level.