@coya/logs
Advanced tools
Comparing version 0.1.2 to 0.1.3
23
logs.js
@@ -85,2 +85,5 @@ const colors = require('colors'); | ||
return new Promise((resolve, reject) => { | ||
if(this.executionMode != PROD_MODE) | ||
return reject('No logs'); | ||
if(this.config.logsCollectionName) { | ||
@@ -108,12 +111,14 @@ if(!this.collectionIsSelected) | ||
clear() { | ||
if(this.config.logsCollectionName) { | ||
if(this.collectionIsSelected) | ||
Database.deleteDocsByPattern(this.config.logsCollectionName, {}); | ||
else | ||
this.promisesQueue.push(Database.deleteDocsByPattern.bind(null, this.config.logsCollectionName, {})); | ||
if(this.executionMode == PROD_MODE) { | ||
if(this.config.logsCollectionName) { | ||
if(this.collectionIsSelected) | ||
Database.deleteDocsByPattern(this.config.logsCollectionName, {}); | ||
else | ||
this.promisesQueue.push(Database.deleteDocsByPattern.bind(null, this.config.logsCollectionName, {})); | ||
} | ||
if(this.logsFile) { | ||
fs.closeSync(this.logsFile); | ||
this.logsFile = fs.openSync(this.config.logsFilePath, 'w'); | ||
} | ||
} | ||
if(this.logsFile) { | ||
fs.closeSync(this.logsFile); | ||
this.logsFile = fs.openSync(this.config.logsFilePath, 'w'); | ||
} | ||
} | ||
@@ -120,0 +125,0 @@ }; |
{ | ||
"name": "@coya/logs", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Logs service", | ||
@@ -5,0 +5,0 @@ "main": "logs.js", |
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
4940
134
2