AIDC Toolkit / Core / MemoryTransport
Class: MemoryTransport<T> ​
Defined in: logger.ts:158
Logger transport that stores messages in memory.
Type Parameters ​
T ​
T extends object
Constructors ​
Constructor ​
new MemoryTransport<
T>(logger,maximumLength,truncateLength?):MemoryTransport<T>
Defined in: logger.ts:192
Constructor.
Parameters ​
logger ​
Logger<T>
Logger.
maximumLength ​
number
Maximum length of messages array.
truncateLength? ​
number
Length to which messages array is truncated when maximum is reached. Default is 50% of maximumLength, maximum is 80% of maximumLength.
Returns ​
MemoryTransport<T>
Accessors ​
messages ​
Get Signature ​
get messages():
string[]
Defined in: logger.ts:215
Get the messages.
Returns ​
string[]
maximumLength ​
Get Signature ​
get maximumLength():
number
Defined in: logger.ts:222
Get the maximum length of messages array.
Returns ​
number
truncateLength ​
Get Signature ​
get truncateLength():
number
Defined in: logger.ts:229
Get the length to which messages array is truncated when maximum is reached.
Returns ​
number
Methods ​
addNotificationCallback() ​
addNotificationCallback(
name,notificationCallback):boolean
Defined in: logger.ts:245
Add a notification callback. If one already exists under the current name, do nothing.
Parameters ​
name ​
string
Callback name.
notificationCallback ​
(message, messages) => void
Callback.
Returns ​
boolean
True if successfully added.
removeNotificationCallback() ​
removeNotificationCallback(
name):void
Defined in: logger.ts:264
Remove a notification callback.
Parameters ​
name ​
string
Callback name.
Returns ​
void
resize() ​
resize(
maximumLength,truncateLength?):void
Defined in: logger.ts:278
Resize the messages array.
Parameters ​
maximumLength ​
number
Maximum length of messages array.
truncateLength? ​
number
Length to which messages array is truncated when maximum is reached. Default is 50% of maximumLength, maximum is 80% of maximumLength.
Returns ​
void