Test the checkout code; publish images only for releases #5
+2
-8
@@ -1,16 +1,10 @@
|
||||
import { winston } from "@strapi/logger";
|
||||
import { formatLogLine } from "../src/logging/format";
|
||||
|
||||
export default {
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
format: winston.format.combine(
|
||||
winston.format.printf(({ timestamp, level, message, ...rest }) => {
|
||||
let restString = JSON.stringify(rest, undefined, 2);
|
||||
restString = restString === "{}" ? "" : restString;
|
||||
|
||||
return `${timestamp}Z ${level}: ${message} ${restString}`;
|
||||
})
|
||||
)
|
||||
format: winston.format.combine(winston.format.printf(formatLogLine))
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/** What winston hands a printf template (logform's TransformableInfo); Strapi's default format has added `timestamp`. */
|
||||
export type LogInfo = {
|
||||
level: string;
|
||||
message: unknown;
|
||||
[key: string | symbol]: unknown;
|
||||
};
|
||||
|
||||
/** One console line: `<timestamp>Z <level>: <message> <all other fields as indented JSON, if any>`. */
|
||||
export const formatLogLine = ({ timestamp, level, message, ...rest }: LogInfo): string => {
|
||||
let restString = JSON.stringify(rest, undefined, 2);
|
||||
restString = restString === "{}" ? "" : restString;
|
||||
|
||||
return `${timestamp}Z ${level}: ${message} ${restString}`;
|
||||
};
|
||||
Reference in New Issue
Block a user