Skip to content

Commit 7370b7e

Browse files
committed
fix colour codes being logged to files
1 parent e942ea6 commit 7370b7e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leekslazylogger",
3-
"version": "4.1.0",
3+
"version": "4.1.1",
44
"description": "An easy-to-use and lightweight logger for Node.js with colours, timestamps, and files.",
55
"main": "dist/",
66
"types": "types/index.d.ts",

src/transports/file/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ export default class FileTransport extends Transport {
7979
.replace(/{+ ?timestamp ?}+/gmi, typeof this.options.timestamp === 'function'
8080
? this.options.timestamp(log.timestamp)
8181
: dtf.fill(this.options.timestamp, log.timestamp));
82-
this.file[log.level.type](content);
82+
this.file[log.level.type](content.replace(/\u001b\[.*?m/g, '')); // eslint-disable-line no-control-regex
8383
}
8484
}

0 commit comments

Comments
 (0)