RemoteSessionLogger class

Logs session activity to a remote endpoint using debug events. The remote debugger is automatically used when the emulator connects to your bot. Non-emulator channels can stream their activity to the emulator by saving the address of the emulator session to session.privateConversationData["BotBuilder.Data.DebugSession"].

Extends

Constructors

RemoteSessionLogger(IConnector, IAddress, IAddress)

Creates an instance of the remote session logger.

Properties

isEnabled

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(IDialogState[], Error)

Logs an error to the output.

flush((err: Error) => void)

Flushes any buffered entries to the output.

log(IDialogState[], string, any[])

Logs an informational level message to the output.

warn(IDialogState[], string, any[])

Logs a warning to the output.

Constructor Details

RemoteSessionLogger(IConnector, IAddress, IAddress)

Creates an instance of the remote session logger.

new RemoteSessionLogger(connector: IConnector, address: IAddress, relatesTo: IAddress)

Parameters

connector
IConnector

Connector used to communicate with the remote endpoint.

address
IAddress

Address to deliver debug events to.

relatesTo
IAddress

Address of the conversation the debug events are for.

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

IDialogState[]

(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

IDialogState[]

(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

IDialogState[]

(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.