Logger: improving the logger, and using it in client code.

This commit is contained in:
John Livingston
2024-06-14 15:17:14 +02:00
parent d931a9c144
commit 2739bb823a
9 changed files with 29 additions and 19 deletions

View File

@ -94,7 +94,7 @@ export class ChannelConfigurationElement extends LivechatElement {
if (error instanceof ValidationError) {
this.validationError = error
}
console.warn(`A validation error occurred in saving configuration. ${error.name}: ${error.message}`)
this.logger.warn(`A validation error occurred in saving configuration. ${error.name}: ${error.message}`)
this.ptNotifier.error(
error.message
? error.message

View File

@ -237,7 +237,7 @@ export class ChannelEmojisElement extends LivechatElement {
a.click()
a.remove()
} catch (err: any) {
console.error(err)
this.logger.error(err)
this.ptNotifier.error(err.toString())
} finally {
this.actionDisabled = false