SessionLogger class
Default session logger used to log session activity to the console.
Properties
is |
If true the logger is enabled and will log the sessions activity. |
Methods
dump(string, any) | Logs the state of a variable to the output. |
error(IDialog |
Logs an error to the output. |
flush((err: Error) => void) | Flushes any buffered entries to the output. |
log(IDialog |
Logs an informational level message to the output. |
warn(IDialog |
Logs a warning to the output. |
Property Details
isEnabled
If true the logger is enabled and will log the sessions activity.
isEnabled: boolean
Property Value
boolean
Method Details
dump(string, any)
Logs the state of a variable to the output.
function dump(name: string, value: any)
Parameters
- name
-
string
Name of the variable being logged.
- value
-
any
Variables current state.
error(IDialogState[], Error)
Logs an error to the output.
function error(dialogStack: IDialogState[], err: Error)
Parameters
- dialogStack
(Optional) dialog stack for the session. This is used to provide context for where the event occured.
- err
-
Error
Error object to log. The errors message plus stack trace will be logged.
flush((err: Error) => void)
Flushes any buffered entries to the output.
function flush(callback: (err: Error) => void)
Parameters
- callback
-
(err: Error) => void
Function to call when the operation is completed.
log(IDialogState[], string, any[])
Logs an informational level message to the output.
function log(dialogStack: IDialogState[], msg: string, args: any[])
Parameters
- dialogStack
(Optional) dialog stack for the session. This is used to provide context for where the event occured.
- msg
-
string
Message to log.
- args
-
any[]
(Optional) arguments to log with the message.
warn(IDialogState[], string, any[])
Logs a warning to the output.
function warn(dialogStack: IDialogState[], msg: string, args: any[])
Parameters
- dialogStack
(Optional) dialog stack for the session. This is used to provide context for where the event occured.
- msg
-
string
Message to log.
- args
-
any[]
(Optional) arguments to log with the message.