@xylabs/logger
Advanced tools
Comparing version 2.13.7 to 2.13.8
@@ -0,2 +1,3 @@ | ||
export * from './IdLogger'; | ||
export * from './Logger'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -22,5 +22,37 @@ // src/Logger.ts | ||
}; | ||
// src/IdLogger.ts | ||
var IdLogger = class { | ||
_id; | ||
_logger; | ||
constructor(logger, id) { | ||
this._logger = logger; | ||
this._id = id; | ||
} | ||
set id(id) { | ||
this._id = () => id; | ||
} | ||
debug(message) { | ||
this._logger?.debug(this.generate(message, getFunctionName(3))); | ||
} | ||
error(message) { | ||
this._logger?.error(this.generate(message, getFunctionName(3))); | ||
} | ||
info(message) { | ||
this._logger?.info(this.generate(message, getFunctionName(3))); | ||
} | ||
log(message) { | ||
this._logger?.log(this.generate(message, getFunctionName(3))); | ||
} | ||
warn(message) { | ||
this._logger?.warn(this.generate(message, getFunctionName(3))); | ||
} | ||
generate(message, tag) { | ||
return `${tag} ${this._id ? `[${this._id}] ` : ""}${typeof message === "string" ? message : typeof message === "object" ? JSON.stringify(message, null, 2) : `${message}`}`; | ||
} | ||
}; | ||
export { | ||
IdLogger, | ||
getFunctionName | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -0,2 +1,3 @@ | ||
export * from './IdLogger'; | ||
export * from './Logger'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -23,5 +23,42 @@ // src/Logger.ts | ||
}; | ||
// src/IdLogger.ts | ||
var IdLogger = class { | ||
_id; | ||
_logger; | ||
constructor(logger, id) { | ||
this._logger = logger; | ||
this._id = id; | ||
} | ||
set id(id) { | ||
this._id = () => id; | ||
} | ||
debug(message) { | ||
var _a; | ||
(_a = this._logger) == null ? void 0 : _a.debug(this.generate(message, getFunctionName(3))); | ||
} | ||
error(message) { | ||
var _a; | ||
(_a = this._logger) == null ? void 0 : _a.error(this.generate(message, getFunctionName(3))); | ||
} | ||
info(message) { | ||
var _a; | ||
(_a = this._logger) == null ? void 0 : _a.info(this.generate(message, getFunctionName(3))); | ||
} | ||
log(message) { | ||
var _a; | ||
(_a = this._logger) == null ? void 0 : _a.log(this.generate(message, getFunctionName(3))); | ||
} | ||
warn(message) { | ||
var _a; | ||
(_a = this._logger) == null ? void 0 : _a.warn(this.generate(message, getFunctionName(3))); | ||
} | ||
generate(message, tag) { | ||
return `${tag} ${this._id ? `[${this._id}] ` : ""}${typeof message === "string" ? message : typeof message === "object" ? JSON.stringify(message, null, 2) : `${message}`}`; | ||
} | ||
}; | ||
export { | ||
IdLogger, | ||
getFunctionName | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -14,3 +14,3 @@ { | ||
"dependencies": { | ||
"@xylabs/error": "~2.13.7" | ||
"@xylabs/error": "~2.13.8" | ||
}, | ||
@@ -60,4 +60,4 @@ "devDependencies": { | ||
"sideEffects": false, | ||
"version": "2.13.7", | ||
"version": "2.13.8", | ||
"type": "module" | ||
} |
@@ -0,1 +1,2 @@ | ||
export * from './IdLogger' | ||
export * from './Logger' |
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
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
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
48119
410
7
Updated@xylabs/error@~2.13.8