diff --git a/package.json b/package.json index d1f68f2..41a8dda 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/transports/file/index.ts b/src/transports/file/index.ts index 5ac714c..f2369dd 100644 --- a/src/transports/file/index.ts +++ b/src/transports/file/index.ts @@ -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 } } \ No newline at end of file