Skip to content

Commit fbdcd5f

Browse files
committed
fix: Remove extra sql level in sql messages
The sql level is being added to the message twice. This fix remove the second one.
1 parent 5d503a9 commit fbdcd5f

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"no-magic-numbers": 0,
1717
"no-tabs": [2, {"allowIndentationTabs": true}],
1818
"multiline-comment-style": [2, "starred-block"],
19-
"padded-blocks": 2,
2019
"require-atomic-updates": 0,
2120
"require-await": 0,
2221
"spaced-comment": [2, "always"],

index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,24 @@ winston.addColors({sql: sqlFormat.color});
1111

1212
const colorizer = format.colorize();
1313
const sqlFormatter = format((info, opts) => {
14-
1514
const level = info[LEVEL];
1615

1716
if (opts.colorize && level === 'sql') {
18-
19-
info.message = colorizer.colorize(level, `${info.level}: ${info.message}\n`);
20-
17+
info.message = colorizer.colorize(level, `${info.message}\n`);
2118
}
2219

2320
return info;
24-
2521
});
2622

2723
function getFormatter({simple}) {
28-
2924
if (simple) {
30-
3125
return format.combine(format.splat(), format.colorize(), sqlFormatter({colorize: true}), format.simple());
32-
3326
}
3427

3528
return format.combine(format.splat(), format.timestamp(), format.json());
36-
3729
}
3830

3931
function getLogger({simple, metadata}) {
40-
4132
return winston.createLogger({
4233
level: simple ? 'debug' : 'info',
4334
levels: {
@@ -48,7 +39,6 @@ function getLogger({simple, metadata}) {
4839
defaultMeta: simple ? {} : metadata,
4940
transports: [new winston.transports.Console()]
5041
});
51-
5242
}
5343

5444
module.exports = getLogger;

0 commit comments

Comments
 (0)