@zthun/lumberjacky-nest 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/logger-nest.d.mts +0 -1
- package/package.json +13 -13
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,10 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
40
40
|
return result;
|
|
41
41
|
};
|
|
42
42
|
const ZLoggerToken = Symbol();
|
|
43
|
-
const ZLoggerProvider = {
|
|
43
|
+
const ZLoggerProvider = {
|
|
44
|
+
provide: ZLoggerToken,
|
|
45
|
+
useValue: new exports.ZLoggerNest()
|
|
46
|
+
};
|
|
44
47
|
exports.ZLoggerModule = class ZLoggerModule {
|
|
45
48
|
};
|
|
46
49
|
exports.ZLoggerModule = __decorateClass([
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/logger/logger-nest.mts","../src/logger/logger-module.mts"],"sourcesContent":["import { Injectable, Logger } from
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/logger/logger-nest.mts","../src/logger/logger-module.mts"],"sourcesContent":["import { Injectable, Logger } from \"@nestjs/common\";\nimport { IZLogEntry, IZLogger, ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * Represents the logger for nestjs.\n *\n * You will import this through the {@link ZLoggerModule} object.\n *\n * You can use this in conjunction with the {@link @zthun/lumberjacky-log#ZLoggerContext} object.\n *\n *\n * @example\n *\n * ```ts\n * import { Injectable, Inject } from '@nestjs/common';\n * import { LoggerToken } from '@zthun/lumberjacky-nest';\n *\n * @Injectable\n * public class MyService {\n * private _logger: IZLogger;\n *\n * public constructor(@Inject(LoggerToken) logger: IZLogger) {\n * this._logger = new ZLoggerContext('MyService', logger);\n * }\n * }\n * ```\n */\n@Injectable()\nexport class ZLoggerNest implements IZLogger {\n private _logger = new Logger();\n\n private _levelMap: Record<ZLogLevel, (l: Logger, entry: IZLogEntry) => void> =\n {\n [ZLogLevel.CATASTROPHE]: (l, e) => l.fatal(e.message, e.context),\n [ZLogLevel.ERROR]: (l, e) => l.error(e.message, e.context),\n [ZLogLevel.INFO]: (l, e) => l.log(e.message, e.context),\n [ZLogLevel.WARNING]: (l, e) => l.warn(e.message, e.context),\n };\n\n public log(entry: IZLogEntry): void {\n this._levelMap[entry.level](this._logger, entry);\n }\n}\n","import { Module, Provider } from \"@nestjs/common\";\nimport { ZLoggerNest } from \"./logger-nest.mjs\";\n\n/**\n * The symbol to use with {@link @nestjs/common#Inject} to add a lumberjacky logger to your service.\n */\nexport const ZLoggerToken = Symbol();\n\nconst ZLoggerProvider: Provider = {\n provide: ZLoggerToken,\n useValue: new ZLoggerNest(),\n};\n\n/**\n * This is the main entrypoint module that injects a default implementation of the logger.\n *\n * @example\n *\n * ```ts\n * import { Module } from '@nestjs/common';\n * import { ZLoggerModule} from '@zthun/lumberjacky-nest';\n *\n * @Module({\n * imports: [ZLoggerModule]\n * })\n * export class MyModule{ }\n * ```\n */\n@Module({\n providers: [ZLoggerProvider, ZLoggerNest],\n exports: [ZLoggerProvider, ZLoggerNest],\n})\nexport class ZLoggerModule {}\n"],"names":["ZLoggerNest","Logger","ZLogLevel","__decorateClass","Injectable","ZLoggerModule","Module"],"mappings":";;;;;;;;;;;;;;AA4BaA,sBAAN,kBAAsC;AAAA,EAAtC,cAAA;AACG,SAAA,UAAU,IAAIC,OAAAA;AAEtB,SAAQ,YACN;AAAA,MACE,CAACC,yBAAU,WAAW,GAAG,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;AAAA,MAC/D,CAACA,yBAAU,KAAK,GAAG,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;AAAA,MACzD,CAACA,yBAAU,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO;AAAA,MACtD,CAACA,yBAAU,OAAO,GAAG,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO;AAAA,IAAA;AAAA,EAC5D;AAAA,EAEK,IAAI,OAAyB;AAClC,SAAK,UAAU,MAAM,KAAK,EAAE,KAAK,SAAS,KAAK;AAAA,EACjD;AACF;AAdaF,QAAN,cAAAG,kBAAA;AAAA,EADNC,kBAAW;AAAA,GACCJ,mBAAA;;;;;;;;;;;ACtBN,MAAM,eAAe,OAAO;AAEnC,MAAM,kBAA4B;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,IAAIA,QAAAA,YAAY;AAC5B;AAqBaK,wBAAN,oBAAoB;AAAC;AAAfA,QAAN,gBAAA,gBAAA;AAAA,EAJNC,cAAO;AAAA,IACN,WAAW,CAAC,iBAAiBN,mBAAW;AAAA,IACxC,SAAS,CAAC,iBAAiBA,mBAAW;AAAA,EAAA,CACvC;AAAA,GACYK,qBAAA;;"}
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,10 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
const ZLoggerToken = Symbol();
|
|
41
|
-
const ZLoggerProvider = {
|
|
41
|
+
const ZLoggerProvider = {
|
|
42
|
+
provide: ZLoggerToken,
|
|
43
|
+
useValue: new ZLoggerNest()
|
|
44
|
+
};
|
|
42
45
|
let ZLoggerModule = class {
|
|
43
46
|
};
|
|
44
47
|
ZLoggerModule = __decorateClass([
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/logger/logger-nest.mts","../src/logger/logger-module.mts"],"sourcesContent":["import { Injectable, Logger } from
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/logger/logger-nest.mts","../src/logger/logger-module.mts"],"sourcesContent":["import { Injectable, Logger } from \"@nestjs/common\";\nimport { IZLogEntry, IZLogger, ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * Represents the logger for nestjs.\n *\n * You will import this through the {@link ZLoggerModule} object.\n *\n * You can use this in conjunction with the {@link @zthun/lumberjacky-log#ZLoggerContext} object.\n *\n *\n * @example\n *\n * ```ts\n * import { Injectable, Inject } from '@nestjs/common';\n * import { LoggerToken } from '@zthun/lumberjacky-nest';\n *\n * @Injectable\n * public class MyService {\n * private _logger: IZLogger;\n *\n * public constructor(@Inject(LoggerToken) logger: IZLogger) {\n * this._logger = new ZLoggerContext('MyService', logger);\n * }\n * }\n * ```\n */\n@Injectable()\nexport class ZLoggerNest implements IZLogger {\n private _logger = new Logger();\n\n private _levelMap: Record<ZLogLevel, (l: Logger, entry: IZLogEntry) => void> =\n {\n [ZLogLevel.CATASTROPHE]: (l, e) => l.fatal(e.message, e.context),\n [ZLogLevel.ERROR]: (l, e) => l.error(e.message, e.context),\n [ZLogLevel.INFO]: (l, e) => l.log(e.message, e.context),\n [ZLogLevel.WARNING]: (l, e) => l.warn(e.message, e.context),\n };\n\n public log(entry: IZLogEntry): void {\n this._levelMap[entry.level](this._logger, entry);\n }\n}\n","import { Module, Provider } from \"@nestjs/common\";\nimport { ZLoggerNest } from \"./logger-nest.mjs\";\n\n/**\n * The symbol to use with {@link @nestjs/common#Inject} to add a lumberjacky logger to your service.\n */\nexport const ZLoggerToken = Symbol();\n\nconst ZLoggerProvider: Provider = {\n provide: ZLoggerToken,\n useValue: new ZLoggerNest(),\n};\n\n/**\n * This is the main entrypoint module that injects a default implementation of the logger.\n *\n * @example\n *\n * ```ts\n * import { Module } from '@nestjs/common';\n * import { ZLoggerModule} from '@zthun/lumberjacky-nest';\n *\n * @Module({\n * imports: [ZLoggerModule]\n * })\n * export class MyModule{ }\n * ```\n */\n@Module({\n providers: [ZLoggerProvider, ZLoggerNest],\n exports: [ZLoggerProvider, ZLoggerNest],\n})\nexport class ZLoggerModule {}\n"],"names":["__decorateClass"],"mappings":";;;;;;;;;;;;AA4BO,IAAM,cAAN,MAAsC;AAAA,EAAtC,cAAA;AACG,SAAA,UAAU,IAAI;AAEtB,SAAQ,YACN;AAAA,MACE,CAAC,UAAU,WAAW,GAAG,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;AAAA,MAC/D,CAAC,UAAU,KAAK,GAAG,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;AAAA,MACzD,CAAC,UAAU,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO;AAAA,MACtD,CAAC,UAAU,OAAO,GAAG,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO;AAAA,IAAA;AAAA,EAC5D;AAAA,EAEK,IAAI,OAAyB;AAClC,SAAK,UAAU,MAAM,KAAK,EAAE,KAAK,SAAS,KAAK;AAAA,EACjD;AACF;AAda,cAANA,kBAAA;AAAA,EADN,WAAW;AAAA,GACC,WAAA;;;;;;;;;;;ACtBN,MAAM,eAAe,OAAO;AAEnC,MAAM,kBAA4B;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,IAAI,YAAY;AAC5B;AAqBO,IAAM,gBAAN,MAAoB;AAAC;AAAf,gBAAN,gBAAA;AAAA,EAJN,OAAO;AAAA,IACN,WAAW,CAAC,iBAAiB,WAAW;AAAA,IACxC,SAAS,CAAC,iBAAiB,WAAW;AAAA,EAAA,CACvC;AAAA,GACY,aAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zthun/lumberjacky-nest",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A lumberjacky log that integrates with the nest framework.",
|
|
5
5
|
"author": "Anthony Bonta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,27 +25,27 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@zthun/lumberjacky-log": "^2.
|
|
29
|
-
"lodash": "^4.17.21",
|
|
28
|
+
"@zthun/lumberjacky-log": "^2.2.0",
|
|
29
|
+
"lodash-es": "^4.17.21",
|
|
30
30
|
"reflect-metadata": "^0.2.2",
|
|
31
31
|
"rxjs": "^7.8.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@nestjs/common": "^10.
|
|
35
|
-
"@nestjs/core": "^10.
|
|
36
|
-
"@nestjs/platform-express": "^10.
|
|
37
|
-
"@nestjs/testing": "^10.
|
|
38
|
-
"typescript": "^5.5.
|
|
39
|
-
"vite": "^5.
|
|
40
|
-
"vitest": "^2.0.
|
|
41
|
-
"vitest-mock-extended": "^
|
|
34
|
+
"@nestjs/common": "^10.4.1",
|
|
35
|
+
"@nestjs/core": "^10.4.1",
|
|
36
|
+
"@nestjs/platform-express": "^10.4.1",
|
|
37
|
+
"@nestjs/testing": "^10.4.1",
|
|
38
|
+
"typescript": "^5.5.4",
|
|
39
|
+
"vite": "^5.4.2",
|
|
40
|
+
"vitest": "^2.0.5",
|
|
41
|
+
"vitest-mock-extended": "^2.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@nestjs/common": "^10.
|
|
44
|
+
"@nestjs/common": "^10.4.0"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist"
|
|
48
48
|
],
|
|
49
49
|
"sideEffects": false,
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "3f632653c6722ca72d9e1c95d8cfafbc6305b051"
|
|
51
51
|
}
|