/ fm / liveswitch / LogEventLogProvider
Class: LogEventLogProvider
fm.liveswitch.LogEventLogProvider
Simple log provider that writes log events to a local array.
Hierarchy
-
↳ LogEventLogProvider
Table of contents
Constructors
Methods
- clear
- doLog
- generateLogLine
- getEvents
- getFilter
- getLevel
- getPrefix
- getProcessId
- getTypeString
- log
- setFilter
- setLevel
- getLogLevelString
- getPrefixTimestamp
- getProduct
Constructors
constructor
+ new LogEventLogProvider(): LogEventLogProvider
Initializes a new instance of the [[fm.liveswitch.logEventLogProvider]].
Returns: LogEventLogProvider
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:16
+ new LogEventLogProvider(level
: LogLevel): LogEventLogProvider
Initializes a new instance of the [[fm.liveswitch.logEventLogProvider]] class.
Parameters:
Name | Type | Description |
---|---|---|
level |
LogLevel | The log level. |
Returns: LogEventLogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:23
Methods
clear
▸ clear(): LogEvent[]
Clears all text from the log and returns the former contents.
Returns: LogEvent[]
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:56
doLog
▸ Protected
doLog(logEvent
: LogEvent): void
Logs a message at the specified log level.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: void
Overrides: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:72
generateLogLine
▸ Protected
generateLogLine(logEvent
: LogEvent): string
Generates a default log line.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: string
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:116
getEvents
▸ getEvents(): LogEvent[]
Gets the logged events.
Returns: LogEvent[]
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:84
getFilter
▸ getFilter(): IFunction1<LogEvent, boolean>
Gets a filter on the log provider.
Returning true
will log the event,
while returning false
will skip it.
Returns: IFunction1<LogEvent, boolean>
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:135
getLevel
▸ getLevel(): LogLevel
Gets the log level.
Returns: LogLevel
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:147
getPrefix
▸ Protected
getPrefix(level
: LogLevel, includeTimestamp
: boolean): string
Converts a log-level to a 5-character string for consistently-spaced character sequences.
Parameters:
Name | Type | Description |
---|---|---|
level |
LogLevel | The log level. |
includeTimestamp |
boolean | Whether to include a timestamp in the prefix. |
Returns: string
The log level as an upper-case string with right-side whitespace padding to ensure a 5-character sequence.
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:165
getProcessId
▸ Protected
getProcessId(): number
Gets the current process id.
Returns: number
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:181
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogEventLogProvider.ts:10
log
▸ log(logEvent
: LogEvent): void
Log a message.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: void
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:194
setFilter
▸ setFilter(value
: IFunction1<LogEvent, boolean>): void
Sets a filter on the log provider.
Returning true
will log the event,
while returning false
will skip it.
Parameters:
Name | Type |
---|---|
value |
IFunction1<LogEvent, boolean> |
Returns: void
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:220
setLevel
▸ setLevel(value
: LogLevel): void
Sets the log level.
Parameters:
Name | Type |
---|---|
value |
LogLevel |
Returns: void
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:232
getLogLevelString
▸ Static
getLogLevelString(level
: LogLevel): string
Converts a log-level to a 5-character string for consistently-spaced character sequences.
Parameters:
Name | Type | Description |
---|---|---|
level |
LogLevel | The log level. |
Returns: string
The log level as an upper-case string with right-side whitespace padding to ensure a 5-character sequence.
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:53
getPrefixTimestamp
▸ Static
getPrefixTimestamp(timestamp
: DateTime): string
Converts a timestamp to an ISO-8601-formatted string for rendering in a log message (YYYY-MM-DDThh:mm:ss.sssZ).
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
DateTime | The timestamp. |
Returns: string
The timestamp as a formatted string.
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:84
getProduct
▸ Static
getProduct(): string
Returns the name of the current product.
Returns: string
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:96