/ fm / liveswitch / DomLogProvider
Class: DomLogProvider
fm.liveswitch.DomLogProvider
Hierarchy
-
↳ DomLogProvider
Table of contents
Constructors
Properties
Methods
- doLog
- generateLogLine
- getFilter
- getLevel
- getPrefix
- getProcessId
- getTypeString
- log
- setFilter
- setLevel
- writeLine
- getLogLevelString
- getPrefixTimestamp
- getProduct
Constructors
constructor
+ new DomLogProvider(container
: HTMLElement, level?
: LogLevel): DomLogProvider
Parameters:
Name | Type |
---|---|
container |
HTMLElement |
level? |
LogLevel |
Returns: DomLogProvider
Inherited from: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/DomLogProvider.ts:7
Properties
_container
• Private
_container: HTMLElement
Defined in: Generated/TypeScript/fm.liveswitch/DomLogProvider.ts:7
Methods
doLog
▸ doLog(logItem
: LogEvent): void
Parameters:
Name | Type |
---|---|
logItem |
LogEvent |
Returns: void
Overrides: LogProvider
Defined in: Generated/TypeScript/fm.liveswitch/DomLogProvider.ts:21
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
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/DomLogProvider.ts:4
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
writeLine
▸ writeLine(text
: string): void
Parameters:
Name | Type |
---|---|
text |
string |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DomLogProvider.ts:16
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