mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33: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
@@ -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