Merge pull request #683 from Cooldude2606/fix/winston-log-format

Bump winston, winston-transport, and resolve type error
This commit is contained in:
Cooldude2606 authored and GitHub committed 2024-11-12 18:11:17 +00:00
commit c6354ded70
6 files changed
+15 -10

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@
"jsonwebtoken": "^9.0.1",
"jszip": "^3.10.1",
"set-blocking": "^2.0.0",
"winston": "^3.10.0",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^4.7.1",
"ws": "^8.13.0",
"yargs": "^17.7.2"
@@ -52,9 +52,9 @@
"react-router-dom": "^6.4.14",
"typescript": "^5.5.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-middleware": "^6.1.1",
"webpack-merge": "^5.9.0",
"webpack-cli": "^5.1.4"
"webpack-merge": "^5.9.0"
},
"publishConfig": {
"access": "public"
+1 -1
View File
@@ -24,7 +24,7 @@
"fs-extra": "^11.1.1",
"phin": "^3.7.0",
"set-blocking": "^2.0.0",
"winston": "^3.10.0",
"winston": "^3.17.0",
"yargs": "^17.7.2"
},
"publishConfig": {
+1 -1
View File
@@ -29,7 +29,7 @@
"rcon-client": "^4.2.3",
"semver": "^7.5.4",
"set-blocking": "^2.0.0",
"winston": "^3.10.0",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^4.7.1",
"yargs": "^17.7.2"
},
+2 -2
View File
@@ -26,8 +26,8 @@
"klaw": "^4.1.0",
"set-blocking": "^2.0.0",
"triple-beam": "^1.4.1",
"winston": "^3.10.0",
"winston-transport": "^4.5.0",
"winston": "^3.17.0",
"winston-transport": "^4.9.0",
"ws": "^8.13.0",
"yargs": "^17.7.2"
},
+1 -1
View File
@@ -72,7 +72,7 @@ export class WebConsoleFormat {
public options = {}
) { }
transform(info: any, _options: object) {
transform(info: any, _options: unknown) {
let src = " ";
if (info.host_id !== undefined) {
src += `h:${info.host_name} - `;
+7 -2
View File
@@ -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) {