rfx-logger
Advanced tools
Comparing version 4.2.1 to 5.0.0
@@ -373,17 +373,23 @@ (function (global, factory) { | ||
RfxLoggerConfig.config = { | ||
disableLogger: false, | ||
disableVerbose: false, | ||
// disableHttpCodes: false, | ||
// disableHttpCallDuration: false, | ||
// disableTime: false, | ||
// devEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.WARNING, | ||
// LogTypeEnum.ERROR, | ||
// LogTypeEnum.TRACE | ||
// ], | ||
// prodEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.ERROR | ||
// ], | ||
production: false, | ||
disableLoggerInDevelopment: false, | ||
disableLoggerInProduction: false, | ||
disableVerboseInDevelopment: false, | ||
disableVerboseInProduction: true, | ||
// disableHttpCodesInDevelopment: false, | ||
// disableHttpcodesInProduction: false; | ||
// disableHttpCallDurationInDevelopment: false; | ||
// disableHttpCallDurationInProduction: true; | ||
disableTimeInDevelopment: false, | ||
disableTimeInProduction: true, | ||
developmentEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.WARNING, | ||
LogTypeEnum.ERROR, | ||
LogTypeEnum.TRACE | ||
], | ||
productionEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.ERROR | ||
], | ||
colorsConfig: [ | ||
@@ -424,10 +430,10 @@ { | ||
this.configuration = configuration; | ||
this.checkProductionVar(configuration); | ||
} | ||
RfxLoggerService.prototype.success = function (message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
var logStyle = this.getMessageStyle(LogTypeEnum.SUCCESS); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.SUCCESS)) { | ||
var logStyle = this.getLogStyle(LogTypeEnum.SUCCESS); | ||
var httpCode = this.getHttpCode(data); | ||
var messageTag = httpCode ? " " + httpCode + " " : 'SUCCESS'; | ||
var formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
var logTag = httpCode ? " " + httpCode + " " : 'SUCCESS'; | ||
var formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -437,8 +443,7 @@ } | ||
RfxLoggerService.prototype.warning = function (message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
var logStyle = this.getMessageStyle(LogTypeEnum.WARNING); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.WARNING)) { | ||
var logStyle = this.getLogStyle(LogTypeEnum.WARNING); | ||
var httpCode = this.getHttpCode(data); | ||
var messageTag = httpCode ? " " + httpCode + " " : 'WARNING'; | ||
var formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
var logTag = httpCode ? " " + httpCode + " " : 'WARNING'; | ||
var formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -448,8 +453,7 @@ } | ||
RfxLoggerService.prototype.error = function (message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
var logStyle = this.getMessageStyle(LogTypeEnum.ERROR); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.ERROR)) { | ||
var logStyle = this.getLogStyle(LogTypeEnum.ERROR); | ||
var httpCode = this.getHttpCode(data); | ||
var messageTag = httpCode ? " " + httpCode + " " : ' ERROR '; | ||
var formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
var logTag = httpCode ? " " + httpCode + " " : ' ERROR '; | ||
var formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -459,8 +463,7 @@ } | ||
RfxLoggerService.prototype.trace = function (message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
var logStyle = this.getMessageStyle(LogTypeEnum.TRACE); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.TRACE)) { | ||
var logStyle = this.getLogStyle(LogTypeEnum.TRACE); | ||
var httpCode = this.getHttpCode(data); | ||
var messageTag = httpCode ? " " + httpCode + " " : ' TRACE '; | ||
var formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
var logTag = httpCode ? " " + httpCode + " " : ' TRACE '; | ||
var formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -475,5 +478,5 @@ } | ||
}; | ||
RfxLoggerService.prototype.getMessageStyle = function (logType) { | ||
var _a, _b, _c, _d; | ||
return (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.colorsConfig) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x.logType === logType; })) !== null && _c !== void 0 ? _c : (_d = RfxLoggerConfig.config.colorsConfig) === null || _d === void 0 ? void 0 : _d.find(function (x) { return x.logType === logType; }); | ||
RfxLoggerService.prototype.getLogStyle = function (logType) { | ||
var colorsConfig = this.getConfigValue('colorsConfig'); | ||
return colorsConfig.find(function (x) { return x.logType === logType; }); | ||
}; | ||
@@ -484,13 +487,12 @@ RfxLoggerService.prototype.getHttpCode = function (data) { | ||
}; | ||
RfxLoggerService.prototype.getFormattedMessage = function (messageTag, message, messageStyle) { | ||
RfxLoggerService.prototype.getFormattedLog = function (messageTag, message, logStyle) { | ||
return [ | ||
"%c " + messageTag + " %c " + this.getCurrentDate() + " - %c" + message, | ||
messageStyle.tagStyle, | ||
messageStyle.timeStyle, | ||
messageStyle.textStyle | ||
"%c " + messageTag + " %c " + (this.isTimeDisabled() ? '' : this.getCurrentDate() + " - ") + "%c" + message, | ||
logStyle.tagStyle, | ||
logStyle.timeStyle, | ||
logStyle.textStyle | ||
]; | ||
}; | ||
RfxLoggerService.prototype.consoleMessage = function (formattedMessage, data) { | ||
var _a; | ||
if (((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableVerbose) || data === undefined) { | ||
if (this.isVerboseDisabled() || data === undefined) { | ||
console.log.apply(console, __spreadArray([], __read(formattedMessage))); | ||
@@ -504,2 +506,29 @@ } | ||
}; | ||
RfxLoggerService.prototype.checkProductionVar = function (configuration) { | ||
if ((configuration === null || configuration === void 0 ? void 0 : configuration.production) === undefined) { | ||
this.warning('Production variable is not set!\nPlease visit https://github.com/RedFoxxo/RFXLibrary/tree/master/projects/rfx-logger#import-module-and-interceptor for more info.'); | ||
} | ||
}; | ||
RfxLoggerService.prototype.getConfigValue = function (field) { | ||
return this.configuration[field] === undefined ? | ||
RfxLoggerConfig.config[field] : | ||
this.configuration[field]; | ||
}; | ||
RfxLoggerService.prototype.isLogTypeEnabled = function (logType) { | ||
var isProduction = this.getConfigValue('production'); | ||
var config = this.getConfigValue(isProduction ? 'productionEnabledLogs' : 'developmentEnabledLogs'); | ||
return !!config.find(function (x) { return x === logType; }); | ||
}; | ||
RfxLoggerService.prototype.isLoggerDisabled = function () { | ||
var isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableLoggerInProduction' : 'disableLoggerInDevelopment'); | ||
}; | ||
RfxLoggerService.prototype.isTimeDisabled = function () { | ||
var isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableTimeInProduction' : 'disableTimeInDevelopment'); | ||
}; | ||
RfxLoggerService.prototype.isVerboseDisabled = function () { | ||
var isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableVerboseInProduction' : 'disableVerboseInDevelopment'); | ||
}; | ||
return RfxLoggerService; | ||
@@ -506,0 +535,0 @@ }()); |
export class ConfigurationModel { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3JmeC1sb2dnZXIvc3JjL2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HJcbiJdfQ== |
export * from './configuration.model'; | ||
export * from './message-style.model'; | ||
export * from './log-style.model'; | ||
export * from './log-type.enum'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9yZngtbG9nZ2VyL3NyYy9saWIvbW9kZWxzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGlCQUFpQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jb25maWd1cmF0aW9uLm1vZGVsJztcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlLXN0eWxlLm1vZGVsJztcclxuZXhwb3J0ICogZnJvbSAnLi9sb2ctdHlwZS5lbnVtJztcclxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9yZngtbG9nZ2VyL3NyYy9saWIvbW9kZWxzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGlCQUFpQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jb25maWd1cmF0aW9uLm1vZGVsJztcclxuZXhwb3J0ICogZnJvbSAnLi9sb2ctc3R5bGUubW9kZWwnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xvZy10eXBlLmVudW0nO1xyXG4iXX0= |
@@ -11,17 +11,23 @@ import { LogTypeEnum } from "./models"; | ||
RfxLoggerConfig.config = { | ||
disableLogger: false, | ||
disableVerbose: false, | ||
// disableHttpCodes: false, | ||
// disableHttpCallDuration: false, | ||
// disableTime: false, | ||
// devEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.WARNING, | ||
// LogTypeEnum.ERROR, | ||
// LogTypeEnum.TRACE | ||
// ], | ||
// prodEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.ERROR | ||
// ], | ||
production: false, | ||
disableLoggerInDevelopment: false, | ||
disableLoggerInProduction: false, | ||
disableVerboseInDevelopment: false, | ||
disableVerboseInProduction: true, | ||
// disableHttpCodesInDevelopment: false, | ||
// disableHttpcodesInProduction: false; | ||
// disableHttpCallDurationInDevelopment: false; | ||
// disableHttpCallDurationInProduction: true; | ||
disableTimeInDevelopment: false, | ||
disableTimeInProduction: true, | ||
developmentEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.WARNING, | ||
LogTypeEnum.ERROR, | ||
LogTypeEnum.TRACE | ||
], | ||
productionEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.ERROR | ||
], | ||
colorsConfig: [ | ||
@@ -58,2 +64,2 @@ { | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmZ4LWxvZ2dlci5jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9yZngtbG9nZ2VyL3NyYy9saWIvcmZ4LWxvZ2dlci5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFzQixXQUFXLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFM0Q7O0dBRUc7QUFDSCxNQUFNLE9BQU8sZUFBZTs7QUFFMUI7O0dBRUc7QUFDb0Isc0JBQU0sR0FBdUI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HJcbiAgICAgIHByb3ZpZGVyczogW1xyXG4gICAgICAgIFJmeExvZ2dlclNlcnZpY2UsXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgcHJvdmlkZTogQ29uZmlndXJhdGlvbk1vZGVsLFxyXG4gICAgICAgICAgdXNlVmFsdWU6IGNvbmZpZ3VyYXRpb25cclxuICAgICAgICB9XHJcbiAgICAgIF1cclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19 |
@@ -10,10 +10,10 @@ import { Injectable, Optional } from '@angular/core'; | ||
this.configuration = configuration; | ||
this.checkProductionVar(configuration); | ||
} | ||
success(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.SUCCESS); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.SUCCESS)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.SUCCESS); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : 'SUCCESS'; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : 'SUCCESS'; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -23,8 +23,7 @@ } | ||
warning(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.WARNING); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.WARNING)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.WARNING); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : 'WARNING'; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : 'WARNING'; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -34,8 +33,7 @@ } | ||
error(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.ERROR); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.ERROR)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.ERROR); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : ' ERROR '; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : ' ERROR '; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -45,8 +43,7 @@ } | ||
trace(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.TRACE); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.TRACE)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.TRACE); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : ' TRACE '; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : ' TRACE '; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -61,5 +58,5 @@ } | ||
} | ||
getMessageStyle(logType) { | ||
var _a, _b, _c, _d; | ||
return (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.colorsConfig) === null || _b === void 0 ? void 0 : _b.find(x => x.logType === logType)) !== null && _c !== void 0 ? _c : (_d = RfxLoggerConfig.config.colorsConfig) === null || _d === void 0 ? void 0 : _d.find(x => x.logType === logType); | ||
getLogStyle(logType) { | ||
const colorsConfig = this.getConfigValue('colorsConfig'); | ||
return colorsConfig.find(x => x.logType === logType); | ||
} | ||
@@ -70,13 +67,12 @@ getHttpCode(data) { | ||
} | ||
getFormattedMessage(messageTag, message, messageStyle) { | ||
getFormattedLog(messageTag, message, logStyle) { | ||
return [ | ||
`%c ${messageTag} %c ${this.getCurrentDate()} - %c${message}`, | ||
messageStyle.tagStyle, | ||
messageStyle.timeStyle, | ||
messageStyle.textStyle | ||
`%c ${messageTag} %c ${this.isTimeDisabled() ? '' : `${this.getCurrentDate()} - `}%c${message}`, | ||
logStyle.tagStyle, | ||
logStyle.timeStyle, | ||
logStyle.textStyle | ||
]; | ||
} | ||
consoleMessage(formattedMessage, data) { | ||
var _a; | ||
if (((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableVerbose) || data === undefined) { | ||
if (this.isVerboseDisabled() || data === undefined) { | ||
console.log(...formattedMessage); | ||
@@ -90,2 +86,29 @@ } | ||
} | ||
checkProductionVar(configuration) { | ||
if ((configuration === null || configuration === void 0 ? void 0 : configuration.production) === undefined) { | ||
this.warning('Production variable is not set!\nPlease visit https://github.com/RedFoxxo/RFXLibrary/tree/master/projects/rfx-logger#import-module-and-interceptor for more info.'); | ||
} | ||
} | ||
getConfigValue(field) { | ||
return this.configuration[field] === undefined ? | ||
RfxLoggerConfig.config[field] : | ||
this.configuration[field]; | ||
} | ||
isLogTypeEnabled(logType) { | ||
const isProduction = this.getConfigValue('production'); | ||
const config = this.getConfigValue(isProduction ? 'productionEnabledLogs' : 'developmentEnabledLogs'); | ||
return !!config.find(x => x === logType); | ||
} | ||
isLoggerDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableLoggerInProduction' : 'disableLoggerInDevelopment'); | ||
} | ||
isTimeDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableTimeInProduction' : 'disableTimeInDevelopment'); | ||
} | ||
isVerboseDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableVerboseInProduction' : 'disableVerboseInDevelopment'); | ||
} | ||
} | ||
@@ -101,2 +124,2 @@ RfxLoggerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function RfxLoggerService_Factory() { return new RfxLoggerService(i0.ɵɵinject(i1.ConfigurationModel, 8)); }, token: RfxLoggerService, providedIn: "root" }); | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmZ4LWxvZ2dlci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcmZ4LWxvZ2dlci9zcmMvbGliL3JmeC1sb2dnZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNyRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsWUFBWSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdkUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLFdBQVcsRUFBcUIsTUFBTSxVQUFVLENBQUM7QUFDOUUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDOzs7QUFLdEQsTUFBTSxPQUFPLGdCQUFnQjtJQUczQixZQUNjLGFBQWlDO1FBRTdDLElBQUksQ0FBQyxhQUFhLEdBQUcsYUFBYSxDQUFDO0lBQ3JDLENBQUM7SUFFTSxPQUFPLENBQUMsT0FBZSxFQUFFLElBQVU7O1FBQ3hDLElBQUksQ0FBQyxDQUFBLE1BQUEsSUFBSSxDQUFDLGFBQWEsMENBQUUsYUFBYSxDQUFBLEVBQUU7WUFDdEMsTUFBTSxRQUFRLEdBQXNCLElBQUksQ0FBQyxlQUFlLENBQUMsV0FBVyxDQUFDLE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-27,17 +27,23 @@ import * as i0 from '@angular/core'; | ||
RfxLoggerConfig.config = { | ||
disableLogger: false, | ||
disableVerbose: false, | ||
// disableHttpCodes: false, | ||
// disableHttpCallDuration: false, | ||
// disableTime: false, | ||
// devEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.WARNING, | ||
// LogTypeEnum.ERROR, | ||
// LogTypeEnum.TRACE | ||
// ], | ||
// prodEnabledLogs: [ | ||
// LogTypeEnum.SUCCESS, | ||
// LogTypeEnum.ERROR | ||
// ], | ||
production: false, | ||
disableLoggerInDevelopment: false, | ||
disableLoggerInProduction: false, | ||
disableVerboseInDevelopment: false, | ||
disableVerboseInProduction: true, | ||
// disableHttpCodesInDevelopment: false, | ||
// disableHttpcodesInProduction: false; | ||
// disableHttpCallDurationInDevelopment: false; | ||
// disableHttpCallDurationInProduction: true; | ||
disableTimeInDevelopment: false, | ||
disableTimeInProduction: true, | ||
developmentEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.WARNING, | ||
LogTypeEnum.ERROR, | ||
LogTypeEnum.TRACE | ||
], | ||
productionEnabledLogs: [ | ||
LogTypeEnum.SUCCESS, | ||
LogTypeEnum.ERROR | ||
], | ||
colorsConfig: [ | ||
@@ -78,10 +84,10 @@ { | ||
this.configuration = configuration; | ||
this.checkProductionVar(configuration); | ||
} | ||
success(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.SUCCESS); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.SUCCESS)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.SUCCESS); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : 'SUCCESS'; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : 'SUCCESS'; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -91,8 +97,7 @@ } | ||
warning(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.WARNING); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.WARNING)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.WARNING); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : 'WARNING'; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : 'WARNING'; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -102,8 +107,7 @@ } | ||
error(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.ERROR); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.ERROR)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.ERROR); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : ' ERROR '; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : ' ERROR '; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -113,8 +117,7 @@ } | ||
trace(message, data) { | ||
var _a; | ||
if (!((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableLogger)) { | ||
const logStyle = this.getMessageStyle(LogTypeEnum.TRACE); | ||
if (!this.isLoggerDisabled() && this.isLogTypeEnabled(LogTypeEnum.TRACE)) { | ||
const logStyle = this.getLogStyle(LogTypeEnum.TRACE); | ||
const httpCode = this.getHttpCode(data); | ||
const messageTag = httpCode ? ` ${httpCode} ` : ' TRACE '; | ||
const formattedMessage = this.getFormattedMessage(messageTag, message, logStyle); | ||
const logTag = httpCode ? ` ${httpCode} ` : ' TRACE '; | ||
const formattedMessage = this.getFormattedLog(logTag, message, logStyle); | ||
this.consoleMessage(formattedMessage, data); | ||
@@ -129,5 +132,5 @@ } | ||
} | ||
getMessageStyle(logType) { | ||
var _a, _b, _c, _d; | ||
return (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.colorsConfig) === null || _b === void 0 ? void 0 : _b.find(x => x.logType === logType)) !== null && _c !== void 0 ? _c : (_d = RfxLoggerConfig.config.colorsConfig) === null || _d === void 0 ? void 0 : _d.find(x => x.logType === logType); | ||
getLogStyle(logType) { | ||
const colorsConfig = this.getConfigValue('colorsConfig'); | ||
return colorsConfig.find(x => x.logType === logType); | ||
} | ||
@@ -138,13 +141,12 @@ getHttpCode(data) { | ||
} | ||
getFormattedMessage(messageTag, message, messageStyle) { | ||
getFormattedLog(messageTag, message, logStyle) { | ||
return [ | ||
`%c ${messageTag} %c ${this.getCurrentDate()} - %c${message}`, | ||
messageStyle.tagStyle, | ||
messageStyle.timeStyle, | ||
messageStyle.textStyle | ||
`%c ${messageTag} %c ${this.isTimeDisabled() ? '' : `${this.getCurrentDate()} - `}%c${message}`, | ||
logStyle.tagStyle, | ||
logStyle.timeStyle, | ||
logStyle.textStyle | ||
]; | ||
} | ||
consoleMessage(formattedMessage, data) { | ||
var _a; | ||
if (((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.disableVerbose) || data === undefined) { | ||
if (this.isVerboseDisabled() || data === undefined) { | ||
console.log(...formattedMessage); | ||
@@ -158,2 +160,29 @@ } | ||
} | ||
checkProductionVar(configuration) { | ||
if ((configuration === null || configuration === void 0 ? void 0 : configuration.production) === undefined) { | ||
this.warning('Production variable is not set!\nPlease visit https://github.com/RedFoxxo/RFXLibrary/tree/master/projects/rfx-logger#import-module-and-interceptor for more info.'); | ||
} | ||
} | ||
getConfigValue(field) { | ||
return this.configuration[field] === undefined ? | ||
RfxLoggerConfig.config[field] : | ||
this.configuration[field]; | ||
} | ||
isLogTypeEnabled(logType) { | ||
const isProduction = this.getConfigValue('production'); | ||
const config = this.getConfigValue(isProduction ? 'productionEnabledLogs' : 'developmentEnabledLogs'); | ||
return !!config.find(x => x === logType); | ||
} | ||
isLoggerDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableLoggerInProduction' : 'disableLoggerInDevelopment'); | ||
} | ||
isTimeDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableTimeInProduction' : 'disableTimeInDevelopment'); | ||
} | ||
isVerboseDisabled() { | ||
const isProduction = this.getConfigValue('production'); | ||
return this.getConfigValue(isProduction ? 'disableVerboseInProduction' : 'disableVerboseInDevelopment'); | ||
} | ||
} | ||
@@ -160,0 +189,0 @@ RfxLoggerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function RfxLoggerService_Factory() { return new RfxLoggerService(i0.ɵɵinject(ConfigurationModel, 8)); }, token: RfxLoggerService, providedIn: "root" }); |
@@ -1,6 +0,14 @@ | ||
import { MessageStyleModel } from "./message-style.model"; | ||
import { LogTypeEnum } from "./log-type.enum"; | ||
import { LogStyleModel } from "./log-style.model"; | ||
export declare class ConfigurationModel { | ||
disableLogger?: boolean; | ||
disableVerbose?: boolean; | ||
colorsConfig?: MessageStyleModel[]; | ||
production?: boolean; | ||
disableLoggerInDevelopment?: boolean; | ||
disableLoggerInProduction?: boolean; | ||
disableVerboseInDevelopment?: boolean; | ||
disableVerboseInProduction?: boolean; | ||
disableTimeInDevelopment?: boolean; | ||
disableTimeInProduction?: boolean; | ||
developmentEnabledLogs?: (LogTypeEnum | string)[]; | ||
productionEnabledLogs?: (LogTypeEnum | string)[]; | ||
colorsConfig?: LogStyleModel[]; | ||
} |
export * from './configuration.model'; | ||
export * from './message-style.model'; | ||
export * from './log-style.model'; | ||
export * from './log-type.enum'; |
@@ -11,6 +11,12 @@ import { ConfigurationModel } from './models'; | ||
private isHttpStatusValid; | ||
private getMessageStyle; | ||
private getLogStyle; | ||
private getHttpCode; | ||
private getFormattedMessage; | ||
private getFormattedLog; | ||
private consoleMessage; | ||
private checkProductionVar; | ||
private getConfigValue; | ||
private isLogTypeEnabled; | ||
private isLoggerDisabled; | ||
private isTimeDisabled; | ||
private isVerboseDisabled; | ||
} |
{ | ||
"name": "rfx-logger", | ||
"version": "4.2.1", | ||
"version": "5.0.0", | ||
"description": "RfxLogger - upgrade your browser console messages", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -18,3 +18,3 @@ # RfxLogger | ||
- Completely disable logger | ||
- ~~Customize data you want to show in development or in production (http code, time, http duration, log types)~~ | ||
- Customize data you want to show in development or in production (http code, time, http duration, log types) | ||
@@ -31,6 +31,7 @@ ## Installation | ||
- __interceptor__ is optional | ||
- `.config` is optional | ||
- `.config` parameters are all optionals except `production` | ||
```typescript | ||
import { RfxLoggerModule, RfxLoggerInterceptor } from 'rfx-logger'; | ||
import { HTTP_INTERCEPTORS } from '@angular/common/http'; | ||
import { environment } from '../environments/environment'; | ||
@@ -40,3 +41,3 @@ @NgModule({ | ||
RfxLoggerModule.config({ | ||
[ ... ] | ||
production: environment.production | ||
}) | ||
@@ -56,12 +57,51 @@ ], | ||
### `disableLogger` _(default `false`)_<br> | ||
If true, completely disable all types of messages | ||
### `disableVerbose` _(default `false`)_<br> | ||
When this option is set to true, logger doesn't print any debug data, just a one line message | ||
### ~~`disableHttpCodes`~~ | ||
### ~~`disableHttpCallDuration`~~ | ||
### ~~`disableTime`~~ | ||
### ~~`devEnabledLogs`~~ | ||
### ~~`prodEnabledLogs`~~ | ||
### `colorsConfig` | ||
### `production`: _boolean_ | ||
_(default value: `false`)_<br> | ||
Environment production variable. | ||
Angular by default store this variable in `../environments/environment` file | ||
(example in 'Import module and interceptor' section). | ||
### `disableLoggerInDevelopment`: _boolean_ | ||
_(default value: `false`)_<br> | ||
If true, completely disable all types of messages in development environment. | ||
### `disableLoggerInProduction`: _boolean_ | ||
_(default value: `false`)_<br> | ||
If true, completely disable all types of messages in production environment. | ||
### `disableVerboseInDevelopment`: _boolean_ | ||
If true, logger doesn't print any debug data in development environment, just a one line message. | ||
### `disableVerboseInProduction`: _boolean_ | ||
_(default value: `true`)_<br> | ||
If true, logger doesn't print any debug data in production environment, just a one line message. | ||
### ~~`disableHttpCodesInDevelopment`: _boolean_~~ | ||
~~_(default value: `false`)_<br>~~ | ||
~~If true, logger doesn't show http code in development environment when http interceptor is used.~~ | ||
### ~~`disableHttpcodesInProduction`: _boolean_~~ | ||
~~_(default value: `false`)_<br>~~ | ||
~~If true, logger doesn't show http code in production environment when http interceptor is used.~~ | ||
### ~~`disableHttpCallDurationInDevelopment`: _boolean_~~ | ||
~~_(default value: `false`)_<br>~~ | ||
~~If true, http calls duration in development environment are hidden~~ | ||
### ~~`disableHttpCallDurationInProduction`: _boolean_~~ | ||
~~_(default value: `true`)_<br>~~ | ||
~~If true, http calls duration in production environment are hidden~~ | ||
### `disableTimeInDevelopment`: _boolean_ | ||
_(default value: `false`)_<br> | ||
If true, disable time inside log in development environment. | ||
### `disableTimeInProduction`: _boolean_ | ||
_(default value: `true`)_<br> | ||
If true, disable time inside log in production environment. | ||
### `developmentEnabledLogs`: _(LogTypeEnum | string)[]_ | ||
_(default value: `['success', 'warning', 'error', 'trace']`)_<br> | ||
Types of logs enabled in development environment. | ||
All logs are enabled by default. | ||
### `productionEnabledLogs`: _(LogTypeEnum | string)[]_ | ||
_(default value: `['success', 'error']`)_<br> | ||
Types of logs enabled in production environment.<br> | ||
You can use an empty array if you want to completely disable logger in production | ||
### `colorsConfig`: _LogStyleModel[]_ | ||
You can customize every message tag, text, time and http response time<br> | ||
@@ -68,0 +108,0 @@ This is the default style: |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"ConfigurationModel":{"__symbolic":"class","members":{}},"RfxLoggerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[],"exports":[]}]}],"members":{},"statics":{"config":{"__symbolic":"function","parameters":["configuration"],"value":{"ngModule":{"__symbolic":"reference","name":"RfxLoggerModule"},"providers":[{"__symbolic":"reference","name":"RfxLoggerService"},{"provide":{"__symbolic":"reference","name":"ɵa"},"useValue":{"__symbolic":"reference","name":"configuration"}}]}}}},"RfxLoggerService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":12,"character":5}}]],"parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"success":[{"__symbolic":"method"}],"warning":[{"__symbolic":"method"}],"error":[{"__symbolic":"method"}],"trace":[{"__symbolic":"method"}],"getCurrentDate":[{"__symbolic":"method"}],"isHttpStatusValid":[{"__symbolic":"method"}],"getMessageStyle":[{"__symbolic":"method"}],"getHttpCode":[{"__symbolic":"method"}],"getFormattedMessage":[{"__symbolic":"method"}],"consoleMessage":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"RfxLoggerInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"RfxLoggerService"}]}],"intercept":[{"__symbolic":"method"}]}}},"origins":{"ConfigurationModel":"./lib/models/configuration.model","RfxLoggerModule":"./lib/rfx-logger.module","RfxLoggerService":"./lib/rfx-logger.service","RfxLoggerInterceptor":"./lib/rfx-logger.interceptor","ɵa":"./lib/models"},"importAs":"rfx-logger"} | ||
{"__symbolic":"module","version":4,"metadata":{"ConfigurationModel":{"__symbolic":"class","members":{}},"RfxLoggerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[],"exports":[]}]}],"members":{},"statics":{"config":{"__symbolic":"function","parameters":["configuration"],"value":{"ngModule":{"__symbolic":"reference","name":"RfxLoggerModule"},"providers":[{"__symbolic":"reference","name":"RfxLoggerService"},{"provide":{"__symbolic":"reference","name":"ɵa"},"useValue":{"__symbolic":"reference","name":"configuration"}}]}}}},"RfxLoggerService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":12,"character":5}}]],"parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"success":[{"__symbolic":"method"}],"warning":[{"__symbolic":"method"}],"error":[{"__symbolic":"method"}],"trace":[{"__symbolic":"method"}],"getCurrentDate":[{"__symbolic":"method"}],"isHttpStatusValid":[{"__symbolic":"method"}],"getLogStyle":[{"__symbolic":"method"}],"getHttpCode":[{"__symbolic":"method"}],"getFormattedLog":[{"__symbolic":"method"}],"consoleMessage":[{"__symbolic":"method"}],"checkProductionVar":[{"__symbolic":"method"}],"getConfigValue":[{"__symbolic":"method"}],"isLogTypeEnabled":[{"__symbolic":"method"}],"isLoggerDisabled":[{"__symbolic":"method"}],"isTimeDisabled":[{"__symbolic":"method"}],"isVerboseDisabled":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"RfxLoggerInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"RfxLoggerService"}]}],"intercept":[{"__symbolic":"method"}]}}},"origins":{"ConfigurationModel":"./lib/models/configuration.model","RfxLoggerModule":"./lib/rfx-logger.module","RfxLoggerService":"./lib/rfx-logger.service","RfxLoggerInterceptor":"./lib/rfx-logger.interceptor","ɵa":"./lib/models"},"importAs":"rfx-logger"} |
Sorry, the diff of this file is not supported yet
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
153564
1180
168