-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2019-2024 Fraunhofer IOSB-INA Lemgo, | ||
* eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft | ||
* zur Foerderung der angewandten Forschung e.V. | ||
* | ||
*****************************************************************************/ | ||
|
||
import Transport from 'winston-transport'; | ||
|
||
export class ConsoleTransport extends Transport { | ||
public override log = (info: { level: string; message: string }, callback: () => void) => { | ||
setImmediate(() => this.emit('logged', info)); | ||
|
||
if (info.level === 'error') { | ||
console.error(info.message); | ||
} else if (info.level === 'warn') { | ||
console.warn(info.message); | ||
} else { | ||
console.info(info.message); | ||
} | ||
|
||
if (callback) { | ||
callback(); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters