/ fm / liveswitch / LogProvider
Class: LogProvider
fm.liveswitch.LogProvider
Base class for all logging provider implementations.
Hierarchy
LogProvider
Table of contents
Constructors
Methods
- doLog
- fmliveswitchLogProviderInit
- generateLogLine
- getFilter
- getLevel
- getPrefix
- getProcessId
- getTypeString
- log
- setFilter
- setLevel
- getLogLevelString
- getPrefixTimestamp
- getProduct
Constructors
constructor
+ new LogProvider(): LogProvider
Initializes a new instance of the [[fm.liveswitch.logProvider]] class using [[fm.liveswitch.log.defaultLogLevel]] as the log level.
Returns: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:22
Methods
doLog
▸ Protected
Abstract
doLog(logEvent
: LogEvent): void
Logs a message at the specified log level.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:109
fmliveswitchLogProviderInit
▸ Private
fmliveswitchLogProviderInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:19
generateLogLine
▸ Protected
generateLogLine(logEvent
: LogEvent): string
Generates a default log line.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:116
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>
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:135
getLevel
▸ getLevel(): LogLevel
Gets the log level.
Returns: LogLevel
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.
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:165
getProcessId
▸ Protected
getProcessId(): number
Gets the current process id.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:181
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:9
log
▸ log(logEvent
: LogEvent): void
Log a message.
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The log event details. |
Returns: void
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
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
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.
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.
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:84
getProduct
▸ Static
getProduct(): string
Returns the name of the current product.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/LogProvider.ts:96