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

think-logger3

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

think-logger3 - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.nyc_output/2a45d702a65f8855e7f3f700dcc17adc.json

2

package.json
{
"name": "think-logger3",
"version": "1.0.1",
"version": "1.0.2",
"description": "logger for ThinkJS 3.x",

@@ -5,0 +5,0 @@ "main": "./src",

@@ -43,3 +43,3 @@ const log4js = require('log4js');

*/
isCluster(config) {
isCluster(config, clusterMode) {
let lConfig = Object.assign({}, config);

@@ -59,3 +59,6 @@ let appenders = config.appenders;

//Master process
if( !Object.keys(cluster.workers).length ) {
if(typeof(clusterMode) === 'undefined') {
clusterMode = Object.keys(cluster.workers).length;
}
if(!clusterMode) {
return config;

@@ -62,0 +65,0 @@ }

const Base = require('./base');
module.exports = class DateFileLogger extends Base {
constructor(config) {
constructor(config, clusterMode) {
super(config);

@@ -19,3 +19,3 @@

//check cluster mode
config = this.isCluster(config);
config = this.isCluster(config, clusterMode);

@@ -22,0 +22,0 @@ this._logger = this.getLogger(config);

const Base = require('./base');
module.exports = class FileLogger extends Base {
constructor(config) {
constructor(config, clusterMode) {
super(config);

@@ -18,3 +18,3 @@

//check cluster mode
config = this.isCluster(config);
config = this.isCluster(config, clusterMode);

@@ -21,0 +21,0 @@ this._logger = this.getLogger(config);

@@ -7,7 +7,7 @@ const assert = require('assert');

class Logger {
constructor(config) {
constructor(config, clusterMode) {
let handle = config.handle;
delete config.handle;
this._logger = new handle(config);
this._logger = new handle(config, clusterMode);
['debug', 'info', 'warn', 'error'].forEach(level => {

@@ -14,0 +14,0 @@ assert(this._logger[level], `adapter function ${level} not exist!`);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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