mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Bump winston@3.17 and resolve type error
This commit is contained in:
5 files changed
+13
-8
No files matched your search
@@ -26,7 +26,7 @@
|
||||
"klaw": "^4.1.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"triple-beam": "^1.4.1",
|
||||
"winston": "^3.10.0",
|
||||
"winston": "^3.17.0",
|
||||
"winston-transport": "^4.5.0",
|
||||
"ws": "^8.13.0",
|
||||
"yargs": "^17.7.2"
|
||||
|
||||
@@ -139,6 +139,10 @@ function formatServerOutput(parsed: ParsedFactorioOutput) {
|
||||
// These are defined here to avoid circular dependencies and pulling them
|
||||
// into the web interface code.
|
||||
|
||||
export interface TerminalFormatOptions extends winston.Logform.ColorizeOptions {
|
||||
showTimestamp?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats winston log messages for a character terminal.
|
||||
*/
|
||||
@@ -146,12 +150,13 @@ export class TerminalFormat {
|
||||
colorize: winston.Logform.Colorizer;
|
||||
|
||||
constructor(
|
||||
public options: object = {}
|
||||
public options: TerminalFormatOptions = {}
|
||||
) {
|
||||
this.colorize = winston.format.colorize(options);
|
||||
}
|
||||
|
||||
transform(info: any, options: { showTimestamp: boolean }) {
|
||||
transform(info: any, opts: unknown) {
|
||||
const options = opts as TerminalFormatOptions;
|
||||
info = this.colorize.transform(info, this.colorize.options);
|
||||
let ts = "";
|
||||
if (options.showTimestamp && info.timestamp) {
|
||||
|
||||
Reference in new issue
Block a user