wickrio-bot-api
Advanced tools
Comparing version 5.96.1 to 5.96.2
{ | ||
"name": "wickrio-bot-api", | ||
"version": "5.96.1", | ||
"version": "5.96.2", | ||
"description": "The official Wickr IO Bot API Framework", | ||
@@ -12,3 +12,3 @@ "main": "src/WickrIOBot.js", | ||
"winston": "^3.3.3", | ||
"winston-daily-rotate-file": "^3.10.0" | ||
"winston-daily-rotate-file": "^4.5.5" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
@@ -7,2 +7,3 @@ const fs = require('fs') | ||
const logDir = 'logs' | ||
const npmLogLevels = ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'] | ||
@@ -16,5 +17,17 @@ class WickrLogger { | ||
const logTokens = JSON.parse(process.env.log_tokens) | ||
level = logTokens.LOG_LEVEL | ||
maxSize = logTokens.LOG_FILE_SIZE | ||
maxFiles = logTokens.LOG_MAX_FILES | ||
if (typeof logTokens.LOG_LEVEL === 'string' && npmLogLevels.includes(logTokens.LOG_LEVEL)) { | ||
level = logTokens.LOG_LEVEL | ||
} else { | ||
console.error(`${logTokens.LOG_LEVEL} is not a valid NPM log level. Log level set to ${level}`) | ||
} | ||
if (typeof logTokens.LOG_FILE_SIZE === 'string' && !isNaN(parseFloat(logTokens.LOG_FILE_SIZE))) { | ||
maxSize = logTokens.LOG_FILE_SIZE | ||
} else { | ||
console.error(`${logTokens.LOG_FILE_SIZE} is not a valid max file size. Max file size set to ${maxSize}`) | ||
} | ||
if (typeof logTokens.LOG_MAX_FILES === 'string' && !isNaN(parseFloat(logTokens.LOG_MAX_FILES))) { | ||
maxFiles = logTokens.LOG_MAX_FILES | ||
} else { | ||
console.error(`${logTokens.LOG_MAX_FILES} is not a valid number of files. Max number of files set to ${maxSize}`) | ||
} | ||
} | ||
@@ -26,2 +39,3 @@ if (!fs.existsSync(logDir)) { | ||
const rotateTransport = new DailyRotateFile({ | ||
@@ -63,2 +77,3 @@ filename: path.join(logDir, 'log'), | ||
this.logger = winston.createLogger(logConfiguration) | ||
this.logger.info(`WickrLogger setup with Log Level: ${level}, Max File Size: ${maxSize}, and Max Number of files: ${maxFiles}`) | ||
} | ||
@@ -65,0 +80,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
120920
2863
+ Addedfile-stream-rotator@0.6.1(transitive)
+ Addedobject-hash@2.2.0(transitive)
+ Addedwinston-daily-rotate-file@4.7.1(transitive)
- Removedcolors@1.4.0(transitive)
- Removedcycle@1.0.3(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfecha@2.3.3(transitive)
- Removedfile-stream-rotator@0.4.1(transitive)
- Removedlogform@1.10.0(transitive)
- Removedobject-hash@1.3.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedwinston-compat@0.1.5(transitive)
- Removedwinston-daily-rotate-file@3.10.0(transitive)