refactor(core): Use logger for packages/cli messages (no-changelog) (#9302)
This commit is contained in:
@@ -10,6 +10,8 @@ import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import { isLogStreamingEnabled } from '../MessageEventBus/MessageEventBusHelper';
|
||||
import { eventMessageGenericDestinationTestEvent } from '../EventMessageClasses/EventMessageGeneric';
|
||||
import type { MessageEventBus, MessageWithCallback } from '../MessageEventBus/MessageEventBus';
|
||||
import Container from 'typedi';
|
||||
import { Logger } from '@/Logger';
|
||||
export const isMessageEventBusDestinationSyslogOptions = (
|
||||
candidate: unknown,
|
||||
): candidate is MessageEventBusDestinationSyslogOptions => {
|
||||
@@ -63,7 +65,7 @@ export class MessageEventBusDestinationSyslog
|
||||
});
|
||||
this.logger.debug(`MessageEventBusDestinationSyslog with id ${this.getId()} initialized`);
|
||||
this.client.on('error', function (error) {
|
||||
console.error(error);
|
||||
Container.get(Logger).error(`${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ export class MessageEventBusDestinationWebhook
|
||||
try {
|
||||
JSON.parse(this.jsonQuery);
|
||||
} catch {
|
||||
console.log('JSON parameter need to be an valid JSON');
|
||||
this.logger.error('JSON parameter need to be an valid JSON');
|
||||
}
|
||||
this.axiosRequestOptions.params = jsonParse(this.jsonQuery);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ export class MessageEventBusDestinationWebhook
|
||||
try {
|
||||
JSON.parse(this.jsonHeaders);
|
||||
} catch {
|
||||
console.log('JSON parameter need to be an valid JSON');
|
||||
this.logger.error('JSON parameter need to be an valid JSON');
|
||||
}
|
||||
this.axiosRequestOptions.headers = jsonParse(this.jsonHeaders);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user