We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See below
v2.5.1
v18.18.0
v5.2.2
No response
import winston, { format } from "winston" const customFormat = format.printf(info => { console.log(info) if (typeof info === "object") info.message = JSON.stringify(info.message, null, 4) let head = `${timeFormat()} ${info.level}: ` let space = "" while (head.length + space.length < 45){ space = space + " " } return head + space + info.message }) function timeFormat() { const date = new Date() return `[${date.getDate().toString().padStart(2, "0")}.${(date.getMonth() + 1).toString().padStart(2, "0")}.${date.getFullYear()} ${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}]` } const loggerFormat = format.combine(format.colorize(), customFormat) export const logger = winston.createLogger({ level: "silly", format: loggerFormat, transports: [ new winston.transports.Console({ level: "debug" }) ] }) logger.debug({type: "Test", error: "Test"}) logger.debug({type: "Test", message: "Test"})
Output:
{ message: { type: 'Test', error: 'Test' }, level: '\x1B[34mdebug\x1B[39m', [Symbol(level)]: 'debug' } [08.10.2023 17:49:57] debug: { "type": "Test", "error": "Test" } { type: 'Test', message: 'Test', level: '\x1B[34mdebug\x1B[39m', [Symbol(level)]: 'debug' } [08.10.2023 17:49:57] debug: "Test"
Expected Output:
{ message: { type: 'Test', error: 'Test' }, level: '\x1B[34mdebug\x1B[39m', [Symbol(level)]: 'debug' } [08.10.2023 17:49:57] debug: { "type": "Test", "error": "Test" } { message: { type: 'Test', message: 'Test' }, level: '\x1B[34mdebug\x1B[39m', [Symbol(level)]: 'debug' } [08.10.2023 17:49:57] debug: { "type": "Test", "error": "Test" }
format
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The problem
See below
What version of Logform presents the issue?
v2.5.1
What version of Node are you using?
v18.18.0
If this is a TypeScript issue, what version of TypeScript are you using?
v5.2.2
If this worked in a previous version of Logform, which was it?
No response
Minimum Working Example
Additional information
Output:
Expected Output:
🔎 Search Terms
format
The text was updated successfully, but these errors were encountered: