Socket
Socket
Sign inDemoInstall

@mdaemon/logfile

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdaemon/logfile - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "@mdaemon/logfile",
"version": "1.0.1",
"version": "1.0.2",
"description": "A node logging utility",

@@ -5,0 +5,0 @@ "type": "module",

@@ -15,2 +15,3 @@ import fs from "fs";

rollover?: boolean;
logToConsole?: boolean;
startLog?: string;

@@ -24,21 +25,19 @@ endLog?: string;

date: string = "";
currentFile: string = "";
logs: string[] = [];
dir: string;
file: string;
logStr: string;
startLog: string;
endLog: string;
rollover: boolean;
logToConsole: boolean = false;
dir: string;
file: string;
constructor(options: LogFileOptions) {
this.dir = options.dir || "./logs";
this.file = options.file || "log-%DATE%.txt";
this.file = options.file || "log-%DATE%.log";
this.logToConsole = options.logToConsole || false;
this.rollover = typeof options.rollover !== "undefined" ? options.rollover : true;

@@ -146,3 +145,5 @@ this.startLog = options.startLog || "-----------------------------------------\n" +

this.logs.push(this.logStr.replace("%DATE%", getDate()).replace("%TIME%", getTime()).replace("%LEVEL%", level.toString()).replace("%MESSAGE%", message));
if (this.logToConsole) {
console.log(message);
}
this.#rollOver();

@@ -149,0 +150,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc