logger4node
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "logger4node", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,5 @@ export declare const enum LogSeverity { | ||
}; | ||
export declare const DisplaySeverityMap: { | ||
[key in LogSeverity]: string; | ||
}; | ||
export declare function setLogLevel(logSeverity: LogSeverity): void; | ||
@@ -13,0 +16,0 @@ export declare function setLogPattern(pattern: string): void; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Logger = exports.setLogSeverityPattern = exports.setLogPattern = exports.setLogLevel = exports.LogLevel = void 0; | ||
exports.Logger = exports.setLogSeverityPattern = exports.setLogPattern = exports.setLogLevel = exports.DisplaySeverityMap = exports.LogLevel = void 0; | ||
const util_1 = __importDefault(require("util")); | ||
@@ -16,11 +16,8 @@ exports.LogLevel = { | ||
}; | ||
const Color = { | ||
severity: '\x1b[33m', | ||
application: '\x1b[36m', | ||
reset: '\x1b[0m', | ||
verbose: '\x1b[37m', | ||
info: '\x1b[35m', | ||
warn: '\x1b[33m', | ||
debug: '\x1b[34m', | ||
error: '\x1b[31m', // Red | ||
exports.DisplaySeverityMap = { | ||
verbose: 'Verbose', | ||
info: 'Info', | ||
warn: 'Warn', | ||
debug: 'Debug', | ||
error: 'Error', | ||
}; | ||
@@ -35,3 +32,3 @@ function generateMatchAndDoesNotMatchArray(input = '') { | ||
operator = '-'; | ||
key = key.substr(1, key.length); | ||
key = key.substring(1, key.length); | ||
} | ||
@@ -119,3 +116,3 @@ key = key.replace(/\*/g, '.*'); | ||
} | ||
console.log(Color.severity, logSeverity, Color.application, this.name, Color[logSeverity], util_1.default.format(formatter, ...this.transformArgs(...args)), Color.reset); | ||
console.log(exports.DisplaySeverityMap[logSeverity], this.name, util_1.default.format(formatter, ...this.transformArgs(...args))); | ||
} | ||
@@ -122,0 +119,0 @@ transformArgs(...args) { |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
33598