Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

winston-daily-rotate-file

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-daily-rotate-file - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

23

index.js

@@ -80,2 +80,3 @@ 'use strict';

this.prepend = options.prepend || false;
this.localTime = options.localTime || false;

@@ -126,9 +127,17 @@ if (this.json) {

var now = new Date();
this._year = now.getUTCFullYear();
this._month = now.getUTCMonth();
this._date = now.getUTCDate();
this._hour = now.getUTCHours();
this._minute = now.getUTCMinutes();
this._weekday = weekday[now.getUTCDay()];
if (this.localTime) {
this._year = now.getFullYear();
this._month = now.getMonth();
this._date = now.getDate();
this._hour = now.getHours();
this._minute = now.getMinutes();
this._weekday = weekday[now.getDay()];
} else {
this._year = now.getUTCFullYear();
this._month = now.getUTCMonth();
this._date = now.getUTCDate();
this._hour = now.getUTCHours();
this._minute = now.getUTCMinutes();
this._weekday = weekday[now.getUTCDay()];
}
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhM])\1?/g;

@@ -135,0 +144,0 @@ var pad = function (val, len) {

{
"name": "winston-daily-rotate-file",
"version": "1.2.0",
"version": "1.3.0",
"description": "A transport for winston which logs to a rotating file each day.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -57,2 +57,13 @@ /* eslint-disable max-nested-callbacks,no-unused-expressions */

it('should have a proper filename when prepend option is false (localtime)', function () {
var now = moment().format('YYYY-MM-DD');
var transport = new DailyRotateFile({
filename: path.join(fixturesDir, 'prepend-false.log'),
localTime: true,
prepend: false
});
expect(transport._getFilename()).to.equal('prepend-false.log.' + now);
});
it('should have a proper filename when prepend options is true', function () {

@@ -59,0 +70,0 @@ var now = moment().utc().format('YYYY-MM-DD');

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