Skip to content

Commit

Permalink
fix colour codes being logged to files
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Oct 1, 2021
1 parent e942ea6 commit 7370b7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leekslazylogger",
"version": "4.1.0",
"version": "4.1.1",
"description": "An easy-to-use and lightweight logger for Node.js with colours, timestamps, and files.",
"main": "dist/",
"types": "types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/transports/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ export default class FileTransport extends Transport {
.replace(/{+ ?timestamp ?}+/gmi, typeof this.options.timestamp === 'function'
? this.options.timestamp(log.timestamp)
: dtf.fill(this.options.timestamp, log.timestamp));
this.file[log.level.type](content);
this.file[log.level.type](content.replace(/\u001b\[.*?m/g, '')); // eslint-disable-line no-control-regex
}
}

0 comments on commit 7370b7e

Please sign in to comment.