mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
logging
This commit is contained in:
@@ -88,9 +88,13 @@ class Dialogflow extends Task {
|
||||
await super.exec(cs);
|
||||
|
||||
try {
|
||||
this.logger.info('Dialogflow:exec');
|
||||
await this.init(cs, ep);
|
||||
this.logger.info('Dialogflow:exec - initialized');
|
||||
await this.startBot();
|
||||
this.logger.info('Dialogflow:exec - started bot');
|
||||
await this.awaitTaskDone();
|
||||
this.logger.info('Dialogflow:exec - done');
|
||||
} catch (err) {
|
||||
this.logger.error({err}, 'Dialogflow:exec error');
|
||||
}
|
||||
@@ -162,10 +166,12 @@ class Dialogflow extends Task {
|
||||
}
|
||||
|
||||
async startBot() {
|
||||
await (this.isCX ? this.startBotCX() : this.startBotES());
|
||||
const fn = this.isCX ? this.startBotCX : this.startBotES;
|
||||
await fn();
|
||||
}
|
||||
|
||||
async startBotES() {
|
||||
this.logger.info('starting dialogflow ES bot');
|
||||
const baseArgs = `${this.ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent}`;
|
||||
if (this.welcomeEventParams) {
|
||||
await this.ep.api(this.cmd, `${baseArgs} '${JSON.stringify(this.welcomeEventParams)}'`);
|
||||
@@ -190,6 +196,8 @@ class Dialogflow extends Task {
|
||||
if (Object.keys(this.queryInput).length > 0) {
|
||||
baseArgs.push(`'${JSON.stringify(this.queryInput)}'`);
|
||||
}
|
||||
this.logger.info({args: baseArgs}, 'starting dialogflow CX bot');
|
||||
|
||||
await this.ep.api(this.cmd, `${baseArgs.join(' ')}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user