Socket
Book a DemoSign in
Socket

@ncoderz/log-m8

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ncoderz/log-m8 - npm Package Compare versions

Comparing version
1.2.2
to
1.2.3
+20
-2
dist/index.cjs

@@ -596,2 +596,3 @@ "use strict";

__publicField(this, "_stream");
__publicField(this, "_streamCreationFailed", false);
}

@@ -602,11 +603,24 @@ init(config, formatter, filters) {

this._filters = filters || [];
const flags = this._config.append ? "a" : "w";
this._stream = (0, import_fs.createWriteStream)(this._config.filename ?? DEFAULT_FILENAME, { flags });
this.enabled = this._config?.enabled !== false;
this.priority = this._config?.priority;
if (this.enabled) {
this._createStream();
}
}
dispose() {
this._stream?.end();
this._stream = void 0;
}
write(event) {
if (this._streamCreationFailed) return;
if (!this._stream) {
try {
this._createStream();
} catch (err) {
if (console && console.error) {
console.error(`LogM8 [FileAppender]: Failed to create file stream: ${err}`);
}
this._streamCreationFailed = true;
}
}
if (!this._stream) return;

@@ -640,2 +654,6 @@ for (const filter of this._filters) {

}
_createStream() {
const flags = this._config?.append ? "a" : "w";
this._stream = (0, import_fs.createWriteStream)(this._config?.filename ?? DEFAULT_FILENAME, { flags });
}
};

@@ -642,0 +660,0 @@ var FileAppenderFactory = class {

@@ -569,2 +569,3 @@ var __defProp = Object.defineProperty;

__publicField(this, "_stream");
__publicField(this, "_streamCreationFailed", false);
}

@@ -575,11 +576,24 @@ init(config, formatter, filters) {

this._filters = filters || [];
const flags = this._config.append ? "a" : "w";
this._stream = createWriteStream(this._config.filename ?? DEFAULT_FILENAME, { flags });
this.enabled = this._config?.enabled !== false;
this.priority = this._config?.priority;
if (this.enabled) {
this._createStream();
}
}
dispose() {
this._stream?.end();
this._stream = void 0;
}
write(event) {
if (this._streamCreationFailed) return;
if (!this._stream) {
try {
this._createStream();
} catch (err) {
if (console && console.error) {
console.error(`LogM8 [FileAppender]: Failed to create file stream: ${err}`);
}
this._streamCreationFailed = true;
}
}
if (!this._stream) return;

@@ -613,2 +627,6 @@ for (const filter of this._filters) {

}
_createStream() {
const flags = this._config?.append ? "a" : "w";
this._stream = createWriteStream(this._config?.filename ?? DEFAULT_FILENAME, { flags });
}
};

@@ -615,0 +633,0 @@ var FileAppenderFactory = class {

+1
-1
{
"name": "@ncoderz/log-m8",
"version": "1.2.2",
"version": "1.2.3",
"description": "Logging system for TypeScript / JavaScript",

@@ -5,0 +5,0 @@ "author": "RA Sewell <richard.sewell@ncoderz.com>",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display