Logger: improving the logger, and using it in client code.
This commit is contained in:
@ -504,7 +504,7 @@ export class DynamicTableFormElement extends LivechatElement {
|
||||
}
|
||||
|
||||
if (!formElement) {
|
||||
console.warn(`value type '${(propertyValue.constructor.toString())}' is incompatible` +
|
||||
this.logger.warn(`value type '${(propertyValue.constructor.toString())}' is incompatible` +
|
||||
`with field type '${propertySchema.inputType as string}' for form entry '${propertyName.toString()}'.`)
|
||||
}
|
||||
|
||||
@ -724,13 +724,13 @@ export class DynamicTableFormElement extends LivechatElement {
|
||||
: undefined
|
||||
|
||||
if (value === undefined) {
|
||||
console.warn('Could not update property : Target or value was undefined')
|
||||
this.logger.warn('Could not update property : Target or value was undefined')
|
||||
return
|
||||
}
|
||||
|
||||
const rowById = this._rowsById.find(rowById => rowById._id === rowId)
|
||||
if (!rowById) {
|
||||
console.warn(`Could not update property : Did not find a property named '${propertyName}' in row '${rowId}'`)
|
||||
this.logger.warn(`Could not update property : Did not find a property named '${propertyName}' in row '${rowId}'`)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ export class ImageFileInputElement extends LivechatElement {
|
||||
this.dispatchEvent(event)
|
||||
} catch (err) {
|
||||
// FIXME: use peertube notifier?
|
||||
console.error(err)
|
||||
this.logger.error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ export class TagsInputElement extends LivechatElement {
|
||||
|
||||
private readonly _addTag = (value: string | undefined): void => {
|
||||
if (value === undefined) {
|
||||
console.warn('Could not add tag : Target or value was undefined')
|
||||
this.logger.warn('Could not add tag : Target or value was undefined')
|
||||
return
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ export class TagsInputElement extends LivechatElement {
|
||||
|
||||
private readonly _removeTag = (index: number): void => {
|
||||
if (index < 0 || index >= this.value.length) {
|
||||
console.warn('Could not remove tag : index out of range')
|
||||
this.logger.warn('Could not remove tag : index out of range')
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user