@vladmandic/pilogger
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "@vladmandic/pilogger", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Simple Logger for NodeJS", | ||
@@ -34,9 +34,5 @@ "main": "pilogger.js", | ||
"chalk": "^4.1.0", | ||
"moment": "^2.27.0" | ||
"dayjs": "^1.8.35" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.7.0", | ||
"eslint-config-airbnb-base": "^14.2.0", | ||
"eslint-plugin-import": "^2.22.0" | ||
} | ||
"devDependencies": {} | ||
} |
@@ -5,3 +5,3 @@ const os = require('os'); | ||
const chalk = require('chalk'); | ||
const moment = require('moment'); | ||
const dayjs = require('dayjs'); | ||
const { Console } = require('console'); | ||
@@ -72,3 +72,3 @@ | ||
function print(...messages) { | ||
const time = moment(Date.now()).format(dateFormat); | ||
const time = dayjs(Date.now()).format(dateFormat); | ||
logger.log(time, ...messages); | ||
@@ -118,3 +118,3 @@ } | ||
elapsed = Math.round(elapsed / 1000000).toLocaleString(); | ||
const time = moment(Date.now()).format(dateFormat); | ||
const time = dayjs(Date.now()).format(dateFormat); | ||
logger.log(time, tags.timed, `${elapsed} ms`, ...messages); | ||
@@ -125,3 +125,3 @@ if (logFileOK) logStream.write(`${tags.timed} ${time} ${elapsed} ms ${combineMessages(...messages)}\n`); | ||
async function log(tag, ...messages) { | ||
const time = moment(Date.now()).format(dateFormat); | ||
const time = dayjs(Date.now()).format(dateFormat); | ||
print(tags[tag], ...messages); | ||
@@ -134,3 +134,3 @@ if (logFileOK) logStream.write(`${time} ${tags[tag]} ${combineMessages(...messages)}\n`); | ||
async function access(...messages) { | ||
const time = moment(Date.now()).format(dateFormat); | ||
const time = dayjs(Date.now()).format(dateFormat); | ||
if (accessFileOK) accessStream.write(`${time} ${combineMessages(...messages)}\n`); | ||
@@ -140,3 +140,3 @@ } | ||
async function client(...messages) { | ||
const time = moment(Date.now()).format(dateFormat); | ||
const time = dayjs(Date.now()).format(dateFormat); | ||
if (clientFileOK) clientStream.write(`${time} ${combineMessages(...messages)}\n`); | ||
@@ -143,0 +143,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
11747
+ Addeddayjs@^1.8.35
+ Addeddayjs@1.11.13(transitive)
- Removedmoment@^2.27.0
- Removedmoment@2.30.1(transitive)