drop syslog

Close #9774
This commit is contained in:
syuilo
2023-02-03 15:08:36 +09:00
parent 449761bada
commit 825551d64f
9 changed files with 4 additions and 78 deletions

View File

@@ -17,15 +17,13 @@ export default class Logger {
private context: Context;
private parentLogger: Logger | null = null;
private store: boolean;
private syslogClient: any | null = null;
constructor(context: string, color?: KEYWORD, store = true, syslogClient = null) {
constructor(context: string, color?: KEYWORD, store = true) {
this.context = {
name: context,
color: color,
};
this.store = store;
this.syslogClient = syslogClient;
}
@bindThis
@@ -69,20 +67,6 @@ export default class Logger {
console.log(important ? chalk.bold(log) : log);
if (level === 'error' && data) console.log(data);
if (store) {
if (this.syslogClient) {
const send =
level === 'error' ? this.syslogClient.error :
level === 'warning' ? this.syslogClient.warning :
level === 'success' ? this.syslogClient.info :
level === 'debug' ? this.syslogClient.info :
level === 'info' ? this.syslogClient.info :
null as never;
send.bind(this.syslogClient)(message).catch(() => {});
}
}
}
@bindThis