@venizia/ignis-helpers 0.4.7-0 → 0.4.7-2
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/LICENSE.md +1 -3
- package/README.md +7 -8
- package/dist/esm/common/redact.d.ts +25 -17
- package/dist/esm/common/redact.d.ts.map +1 -1
- package/dist/esm/common/redact.js +50 -46
- package/dist/esm/common/redact.js.map +1 -1
- package/dist/esm/common/resolvers.d.ts +7 -5
- package/dist/esm/common/resolvers.d.ts.map +1 -1
- package/dist/esm/common/resolvers.js +11 -9
- package/dist/esm/common/resolvers.js.map +1 -1
- package/dist/esm/core.d.ts +5 -3
- package/dist/esm/core.d.ts.map +1 -1
- package/dist/esm/core.js +7 -3
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/modules/base.d.ts +1 -1
- package/dist/esm/modules/base.d.ts.map +1 -1
- package/dist/esm/modules/base.js +14 -5
- package/dist/esm/modules/base.js.map +1 -1
- package/dist/esm/modules/cron/helper.js +4 -4
- package/dist/esm/modules/cron/helper.js.map +1 -1
- package/dist/esm/modules/crypto/algorithms/aes-legacy.algorithm.js +3 -3
- package/dist/esm/modules/crypto/algorithms/aes-legacy.algorithm.js.map +1 -1
- package/dist/esm/modules/crypto/algorithms/aes.algorithm.js +5 -5
- package/dist/esm/modules/crypto/algorithms/aes.algorithm.js.map +1 -1
- package/dist/esm/modules/crypto/algorithms/base.algorithm.js +3 -3
- package/dist/esm/modules/crypto/algorithms/base.algorithm.js.map +1 -1
- package/dist/esm/modules/crypto/algorithms/hash.algorithm.d.ts +15 -5
- package/dist/esm/modules/crypto/algorithms/hash.algorithm.d.ts.map +1 -1
- package/dist/esm/modules/crypto/algorithms/hash.algorithm.js +16 -4
- package/dist/esm/modules/crypto/algorithms/hash.algorithm.js.map +1 -1
- package/dist/esm/modules/env/app-env.d.ts.map +1 -1
- package/dist/esm/modules/env/app-env.js +2 -2
- package/dist/esm/modules/env/app-env.js.map +1 -1
- package/dist/esm/modules/logger/base/base.d.ts.map +1 -1
- package/dist/esm/modules/logger/base/base.js +3 -3
- package/dist/esm/modules/logger/base/base.js.map +1 -1
- package/dist/esm/modules/logger/base/console.d.ts +9 -4
- package/dist/esm/modules/logger/base/console.d.ts.map +1 -1
- package/dist/esm/modules/logger/base/console.js +15 -4
- package/dist/esm/modules/logger/base/console.js.map +1 -1
- package/dist/esm/modules/logger/common/constants.d.ts +23 -22
- package/dist/esm/modules/logger/common/constants.d.ts.map +1 -1
- package/dist/esm/modules/logger/common/constants.js +43 -46
- package/dist/esm/modules/logger/common/constants.js.map +1 -1
- package/dist/esm/modules/logger/common/debug-gate.d.ts +33 -0
- package/dist/esm/modules/logger/common/debug-gate.d.ts.map +1 -0
- package/dist/esm/modules/logger/common/debug-gate.js +51 -0
- package/dist/esm/modules/logger/common/debug-gate.js.map +1 -0
- package/dist/esm/modules/logger/common/index.d.ts +1 -0
- package/dist/esm/modules/logger/common/index.d.ts.map +1 -1
- package/dist/esm/modules/logger/common/index.js +1 -0
- package/dist/esm/modules/logger/common/index.js.map +1 -1
- package/dist/esm/modules/logger/common/types.d.ts +7 -0
- package/dist/esm/modules/logger/common/types.d.ts.map +1 -1
- package/dist/esm/modules/logger/common/types.js +16 -0
- package/dist/esm/modules/logger/common/types.js.map +1 -1
- package/dist/esm/modules/logger/factory.d.ts +29 -10
- package/dist/esm/modules/logger/factory.d.ts.map +1 -1
- package/dist/esm/modules/logger/factory.js +108 -48
- package/dist/esm/modules/logger/factory.js.map +1 -1
- package/dist/esm/modules/logger/formatting/deep-splat.d.ts +10 -6
- package/dist/esm/modules/logger/formatting/deep-splat.d.ts.map +1 -1
- package/dist/esm/modules/logger/formatting/deep-splat.js +73 -62
- package/dist/esm/modules/logger/formatting/deep-splat.js.map +1 -1
- package/dist/esm/modules/logger/formatting/error-prettier.d.ts.map +1 -1
- package/dist/esm/modules/logger/formatting/error-prettier.js +8 -6
- package/dist/esm/modules/logger/formatting/error-prettier.js.map +1 -1
- package/dist/esm/modules/logger/hf/logger.d.ts.map +1 -1
- package/dist/esm/modules/logger/hf/logger.js +5 -5
- package/dist/esm/modules/logger/hf/logger.js.map +1 -1
- package/dist/esm/modules/logger/index.d.ts +0 -1
- package/dist/esm/modules/logger/index.d.ts.map +1 -1
- package/dist/esm/modules/logger/index.js +0 -1
- package/dist/esm/modules/logger/index.js.map +1 -1
- package/dist/esm/modules/logger/pino/backing.d.ts +0 -9
- package/dist/esm/modules/logger/pino/backing.d.ts.map +1 -1
- package/dist/esm/modules/logger/pino/backing.js +3 -8
- package/dist/esm/modules/logger/pino/backing.js.map +1 -1
- package/dist/esm/modules/logger/pino/destination.d.ts +6 -9
- package/dist/esm/modules/logger/pino/destination.d.ts.map +1 -1
- package/dist/esm/modules/logger/pino/destination.js +12 -13
- package/dist/esm/modules/logger/pino/destination.js.map +1 -1
- package/dist/esm/modules/logger/pino/logger.js +2 -2
- package/dist/esm/modules/logger/pino/logger.js.map +1 -1
- package/dist/esm/modules/logger/winston/common/constants.d.ts.map +1 -1
- package/dist/esm/modules/logger/winston/common/constants.js +7 -6
- package/dist/esm/modules/logger/winston/common/constants.js.map +1 -1
- package/dist/esm/modules/logger/winston/define.d.ts +0 -7
- package/dist/esm/modules/logger/winston/define.d.ts.map +1 -1
- package/dist/esm/modules/logger/winston/define.js +0 -5
- package/dist/esm/modules/logger/winston/define.js.map +1 -1
- package/dist/esm/modules/logger/winston/formats.d.ts +2 -0
- package/dist/esm/modules/logger/winston/formats.d.ts.map +1 -1
- package/dist/esm/modules/logger/winston/formats.js +17 -4
- package/dist/esm/modules/logger/winston/formats.js.map +1 -1
- package/dist/esm/modules/logger/winston/index.d.ts +3 -2
- package/dist/esm/modules/logger/winston/index.d.ts.map +1 -1
- package/dist/esm/modules/logger/winston/index.js +3 -2
- package/dist/esm/modules/logger/winston/index.js.map +1 -1
- package/dist/esm/modules/logger/winston/logger-factory.js +4 -4
- package/dist/esm/modules/logger/winston/logger-factory.js.map +1 -1
- package/dist/esm/modules/network/http-request/base-network-request.helper.js +2 -2
- package/dist/esm/modules/network/http-request/base-network-request.helper.js.map +1 -1
- package/dist/esm/modules/network/http-request/common/index.d.ts +0 -1
- package/dist/esm/modules/network/http-request/common/index.d.ts.map +1 -1
- package/dist/esm/modules/network/http-request/common/index.js +0 -1
- package/dist/esm/modules/network/http-request/common/index.js.map +1 -1
- package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.d.ts.map +1 -1
- package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.js +4 -2
- package/dist/esm/modules/network/http-request/fetcher/axios-fetcher.js.map +1 -1
- package/dist/esm/modules/network/http-request/fetcher/node-fetcher.d.ts.map +1 -1
- package/dist/esm/modules/network/http-request/fetcher/node-fetcher.js +6 -4
- package/dist/esm/modules/network/http-request/fetcher/node-fetcher.js.map +1 -1
- package/dist/esm/modules/network/tcp-socket/base-tcp-client.helper.js +4 -4
- package/dist/esm/modules/network/tcp-socket/base-tcp-client.helper.js.map +1 -1
- package/dist/esm/modules/network/tcp-socket/base-tcp-server.helper.js +4 -4
- package/dist/esm/modules/network/tcp-socket/base-tcp-server.helper.js.map +1 -1
- package/dist/esm/modules/network/udp-socket/network-udp-client.helper.js +2 -2
- package/dist/esm/modules/network/udp-socket/network-udp-client.helper.js.map +1 -1
- package/dist/esm/modules/network/utilities/query-string.d.ts +22 -20
- package/dist/esm/modules/network/utilities/query-string.d.ts.map +1 -1
- package/dist/esm/modules/network/utilities/query-string.js +48 -46
- package/dist/esm/modules/network/utilities/query-string.js.map +1 -1
- package/dist/esm/modules/network/utilities/url-safety/common/errors.d.ts +0 -10
- package/dist/esm/modules/network/utilities/url-safety/common/errors.d.ts.map +1 -1
- package/dist/esm/modules/network/utilities/url-safety/common/errors.js +0 -11
- package/dist/esm/modules/network/utilities/url-safety/common/errors.js.map +1 -1
- package/dist/esm/modules/network/utilities/url-safety/policy.d.ts +10 -0
- package/dist/esm/modules/network/utilities/url-safety/policy.d.ts.map +1 -1
- package/dist/esm/modules/network/utilities/url-safety/policy.js +11 -0
- package/dist/esm/modules/network/utilities/url-safety/policy.js.map +1 -1
- package/dist/esm/modules/queue/bullmq/helper.d.ts.map +1 -1
- package/dist/esm/modules/queue/bullmq/helper.js +6 -6
- package/dist/esm/modules/queue/bullmq/helper.js.map +1 -1
- package/dist/esm/modules/queue/common/hook.d.ts +14 -12
- package/dist/esm/modules/queue/common/hook.d.ts.map +1 -1
- package/dist/esm/modules/queue/common/hook.js +21 -19
- package/dist/esm/modules/queue/common/hook.js.map +1 -1
- package/dist/esm/modules/queue/common/index.d.ts +0 -1
- package/dist/esm/modules/queue/common/index.d.ts.map +1 -1
- package/dist/esm/modules/queue/common/index.js +0 -1
- package/dist/esm/modules/queue/common/index.js.map +1 -1
- package/dist/esm/modules/queue/internal/sequential/helper.js +8 -8
- package/dist/esm/modules/queue/internal/sequential/helper.js.map +1 -1
- package/dist/esm/modules/queue/kafka/base.js +3 -3
- package/dist/esm/modules/queue/kafka/base.js.map +1 -1
- package/dist/esm/modules/queue/kafka/bundler/index.d.ts +0 -2
- package/dist/esm/modules/queue/kafka/bundler/index.d.ts.map +1 -1
- package/dist/esm/modules/queue/kafka/bundler/index.js +0 -2
- package/dist/esm/modules/queue/kafka/bundler/index.js.map +1 -1
- package/dist/esm/modules/queue/kafka/bundler/plugins.d.ts +8 -2
- package/dist/esm/modules/queue/kafka/bundler/plugins.d.ts.map +1 -1
- package/dist/esm/modules/queue/kafka/bundler/plugins.js +64 -7
- package/dist/esm/modules/queue/kafka/bundler/plugins.js.map +1 -1
- package/dist/esm/modules/queue/kafka/consumer.d.ts.map +1 -1
- package/dist/esm/modules/queue/kafka/consumer.js +22 -22
- package/dist/esm/modules/queue/kafka/consumer.js.map +1 -1
- package/dist/esm/modules/queue/mqtt/helper.js +10 -10
- package/dist/esm/modules/queue/mqtt/helper.js.map +1 -1
- package/dist/esm/modules/redis/base/abstract.helper.js +8 -8
- package/dist/esm/modules/redis/base/abstract.helper.js.map +1 -1
- package/dist/esm/modules/redis/cluster/cluster.helper.js +2 -2
- package/dist/esm/modules/redis/cluster/cluster.helper.js.map +1 -1
- package/dist/esm/modules/redis/factory.d.ts +13 -9
- package/dist/esm/modules/redis/factory.d.ts.map +1 -1
- package/dist/esm/modules/redis/factory.js +15 -13
- package/dist/esm/modules/redis/factory.js.map +1 -1
- package/dist/esm/modules/redis/sentinel/sentinel.helper.js +2 -2
- package/dist/esm/modules/redis/sentinel/sentinel.helper.js.map +1 -1
- package/dist/esm/modules/redis/single/single.helper.js +2 -2
- package/dist/esm/modules/redis/single/single.helper.js.map +1 -1
- package/dist/esm/modules/redis/utility.d.ts +13 -11
- package/dist/esm/modules/redis/utility.d.ts.map +1 -1
- package/dist/esm/modules/redis/utility.js +46 -44
- package/dist/esm/modules/redis/utility.js.map +1 -1
- package/dist/esm/modules/retry/helper.js +2 -2
- package/dist/esm/modules/retry/helper.js.map +1 -1
- package/dist/esm/modules/secrets/factory.d.ts +5 -3
- package/dist/esm/modules/secrets/factory.d.ts.map +1 -1
- package/dist/esm/modules/secrets/factory.js +36 -34
- package/dist/esm/modules/secrets/factory.js.map +1 -1
- package/dist/esm/modules/socket/socket-io/server/helper.d.ts.map +1 -1
- package/dist/esm/modules/socket/socket-io/server/helper.js +11 -11
- package/dist/esm/modules/socket/socket-io/server/helper.js.map +1 -1
- package/dist/esm/modules/socket/websocket/emitter/helper.d.ts.map +1 -1
- package/dist/esm/modules/socket/websocket/emitter/helper.js +3 -3
- package/dist/esm/modules/socket/websocket/emitter/helper.js.map +1 -1
- package/dist/esm/modules/socket/websocket/server/delivery.d.ts.map +1 -1
- package/dist/esm/modules/socket/websocket/server/delivery.js +5 -6
- package/dist/esm/modules/socket/websocket/server/delivery.js.map +1 -1
- package/dist/esm/modules/socket/websocket/server/helper.d.ts.map +1 -1
- package/dist/esm/modules/socket/websocket/server/helper.js +7 -7
- package/dist/esm/modules/socket/websocket/server/helper.js.map +1 -1
- package/dist/esm/modules/storage/base.js +7 -7
- package/dist/esm/modules/storage/base.js.map +1 -1
- package/dist/esm/modules/storage/bun-s3/helper.d.ts.map +1 -1
- package/dist/esm/modules/storage/bun-s3/helper.js +25 -18
- package/dist/esm/modules/storage/bun-s3/helper.js.map +1 -1
- package/dist/esm/modules/storage/bun-s3/utility.d.ts +95 -77
- package/dist/esm/modules/storage/bun-s3/utility.d.ts.map +1 -1
- package/dist/esm/modules/storage/bun-s3/utility.js +261 -239
- package/dist/esm/modules/storage/bun-s3/utility.js.map +1 -1
- package/dist/esm/modules/storage/common/errors.d.ts +0 -4
- package/dist/esm/modules/storage/common/errors.d.ts.map +1 -1
- package/dist/esm/modules/storage/common/errors.js +0 -10
- package/dist/esm/modules/storage/common/errors.js.map +1 -1
- package/dist/esm/modules/storage/common/utility.d.ts +11 -5
- package/dist/esm/modules/storage/common/utility.d.ts.map +1 -1
- package/dist/esm/modules/storage/common/utility.js +30 -17
- package/dist/esm/modules/storage/common/utility.js.map +1 -1
- package/dist/esm/modules/uid/uuid/helper.d.ts +1 -1
- package/dist/esm/modules/uid/uuid/helper.d.ts.map +1 -1
- package/dist/esm/modules/uid/uuid/helper.js +7 -7
- package/dist/esm/modules/uid/uuid/helper.js.map +1 -1
- package/dist/esm/modules/uid/uuid/v4.d.ts +11 -8
- package/dist/esm/modules/uid/uuid/v4.d.ts.map +1 -1
- package/dist/esm/modules/uid/uuid/v4.js +51 -46
- package/dist/esm/modules/uid/uuid/v4.js.map +1 -1
- package/dist/esm/modules/uid/uuid/v5.d.ts +17 -14
- package/dist/esm/modules/uid/uuid/v5.d.ts.map +1 -1
- package/dist/esm/modules/uid/uuid/v5.js +83 -78
- package/dist/esm/modules/uid/uuid/v5.js.map +1 -1
- package/dist/esm/modules/uid/uuid/v7.d.ts +15 -10
- package/dist/esm/modules/uid/uuid/v7.d.ts.map +1 -1
- package/dist/esm/modules/uid/uuid/v7.js +88 -79
- package/dist/esm/modules/uid/uuid/v7.js.map +1 -1
- package/dist/esm/modules/worker-thread/bus/base.js +2 -2
- package/dist/esm/modules/worker-thread/bus/base.js.map +1 -1
- package/dist/esm/modules/worker-thread/worker/base.d.ts.map +1 -1
- package/dist/esm/modules/worker-thread/worker/base.js +4 -3
- package/dist/esm/modules/worker-thread/worker/base.js.map +1 -1
- package/dist/esm/utilities/error.utility.d.ts +7 -0
- package/dist/esm/utilities/error.utility.d.ts.map +1 -0
- package/dist/esm/utilities/error.utility.js +9 -0
- package/dist/esm/utilities/error.utility.js.map +1 -0
- package/dist/esm/utilities/form-body.utility.d.ts +12 -10
- package/dist/esm/utilities/form-body.utility.d.ts.map +1 -1
- package/dist/esm/utilities/form-body.utility.js +19 -17
- package/dist/esm/utilities/form-body.utility.js.map +1 -1
- package/dist/esm/utilities/hr-time.utility.d.ts +7 -5
- package/dist/esm/utilities/hr-time.utility.d.ts.map +1 -1
- package/dist/esm/utilities/hr-time.utility.js +11 -9
- package/dist/esm/utilities/hr-time.utility.js.map +1 -1
- package/dist/esm/utilities/index.d.ts +2 -2
- package/dist/esm/utilities/index.d.ts.map +1 -1
- package/dist/esm/utilities/index.js +2 -2
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/module.utility.d.ts.map +1 -1
- package/dist/esm/utilities/module.utility.js +1 -0
- package/dist/esm/utilities/module.utility.js.map +1 -1
- package/dist/esm/utilities/parse.utility.d.ts +89 -43
- package/dist/esm/utilities/parse.utility.d.ts.map +1 -1
- package/dist/esm/utilities/parse.utility.js +173 -141
- package/dist/esm/utilities/parse.utility.js.map +1 -1
- package/dist/esm/utilities/performance.utility.d.ts +15 -13
- package/dist/esm/utilities/performance.utility.d.ts.map +1 -1
- package/dist/esm/utilities/performance.utility.js +34 -29
- package/dist/esm/utilities/performance.utility.js.map +1 -1
- package/dist/esm/utilities/promise.utility.d.ts +20 -18
- package/dist/esm/utilities/promise.utility.d.ts.map +1 -1
- package/dist/esm/utilities/promise.utility.js +41 -51
- package/dist/esm/utilities/promise.utility.js.map +1 -1
- package/dist/esm/utilities/request.utility.d.ts +35 -29
- package/dist/esm/utilities/request.utility.d.ts.map +1 -1
- package/dist/esm/utilities/request.utility.js +118 -115
- package/dist/esm/utilities/request.utility.js.map +1 -1
- package/package.json +4 -15
- package/dist/esm/modules/logger/resolver.d.ts +0 -33
- package/dist/esm/modules/logger/resolver.d.ts.map +0 -1
- package/dist/esm/modules/logger/resolver.js +0 -95
- package/dist/esm/modules/logger/resolver.js.map +0 -1
- package/dist/esm/modules/logger/slot.d.ts +0 -23
- package/dist/esm/modules/logger/slot.d.ts.map +0 -1
- package/dist/esm/modules/logger/slot.js +0 -119
- package/dist/esm/modules/logger/slot.js.map +0 -1
- package/dist/esm/modules/logger/winston/formatters/deep-splat.d.ts +0 -4
- package/dist/esm/modules/logger/winston/formatters/deep-splat.d.ts.map +0 -1
- package/dist/esm/modules/logger/winston/formatters/deep-splat.js +0 -14
- package/dist/esm/modules/logger/winston/formatters/deep-splat.js.map +0 -1
- package/dist/esm/modules/logger/winston/formatters/index.d.ts +0 -2
- package/dist/esm/modules/logger/winston/formatters/index.d.ts.map +0 -1
- package/dist/esm/modules/logger/winston/formatters/index.js +0 -2
- package/dist/esm/modules/logger/winston/formatters/index.js.map +0 -1
- package/dist/esm/modules/network/http-request/common/types.d.ts +0 -2
- package/dist/esm/modules/network/http-request/common/types.d.ts.map +0 -1
- package/dist/esm/modules/network/http-request/common/types.js +0 -2
- package/dist/esm/modules/network/http-request/common/types.js.map +0 -1
- package/dist/esm/modules/queue/common/types.d.ts +0 -2
- package/dist/esm/modules/queue/common/types.d.ts.map +0 -1
- package/dist/esm/modules/queue/common/types.js +0 -2
- package/dist/esm/modules/queue/common/types.js.map +0 -1
- package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts +0 -4
- package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts.map +0 -1
- package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.js +0 -28
- package/dist/esm/modules/queue/kafka/bundler/platformatic-require.plugin.js.map +0 -1
- package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts +0 -4
- package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts.map +0 -1
- package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.js +0 -26
- package/dist/esm/modules/queue/kafka/bundler/platformatic-wasm.plugin.js.map +0 -1
- package/dist/esm/modules/storage/minio/helper.d.ts +0 -55
- package/dist/esm/modules/storage/minio/helper.d.ts.map +0 -1
- package/dist/esm/modules/storage/minio/helper.js +0 -177
- package/dist/esm/modules/storage/minio/helper.js.map +0 -1
- package/dist/esm/modules/storage/minio/index.d.ts +0 -2
- package/dist/esm/modules/storage/minio/index.d.ts.map +0 -1
- package/dist/esm/modules/storage/minio/index.js +0 -2
- package/dist/esm/modules/storage/minio/index.js.map +0 -1
- package/dist/esm/utilities/sleep.utility.d.ts +0 -2
- package/dist/esm/utilities/sleep.utility.d.ts.map +0 -1
- package/dist/esm/utilities/sleep.utility.js +0 -4
- package/dist/esm/utilities/sleep.utility.js.map +0 -1
|
@@ -7,26 +7,27 @@ export declare class LoggerFormats {
|
|
|
7
7
|
static isValid(input: string): input is TLoggerFormat;
|
|
8
8
|
}
|
|
9
9
|
export type TLoggerFormat = TConstValue<typeof LoggerFormats>;
|
|
10
|
-
export declare
|
|
11
|
-
/** The logger's own level, below which a line never reaches ANY transport. Defaults to `debug` - level gating belongs to the wrapper and each transport, and a stricter default here would silently drop lines the wrapper already let through. */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
10
|
+
export declare class LoggerConfigUtility {
|
|
11
|
+
/** The logger's own level, below which a line never reaches ANY transport. Defaults to `debug` - level gating belongs to the wrapper and each transport, and a stricter default here would silently drop lines the wrapper already let through. */
|
|
12
|
+
static resolveLevel(opts: {
|
|
13
|
+
configured?: string;
|
|
14
|
+
}): TLogLevel;
|
|
15
|
+
/**
|
|
16
|
+
* Whether log lines may carry ANSI color, resolved at CALL time. First match wins:
|
|
17
|
+
*
|
|
18
|
+
* 1. `APP_ENV_LOGGER_COLOR` - an explicit yes or no from the operator.
|
|
19
|
+
* 2. `NO_COLOR`, set to anything non-empty - the no-color.org convention.
|
|
20
|
+
* 3. `NODE_ENV` outside {@link Environment.DEVELOPMENT_ENVS} - production, staging, uat and any
|
|
21
|
+
* unrecognized name. Fail-closed, the same boundary the error sanitizer draws: colors are a
|
|
22
|
+
* terminal affordance, and in a deployed environment the same bytes land in a file or an
|
|
23
|
+
* aggregator as escape noise every grep then has to strip.
|
|
24
|
+
*
|
|
25
|
+
* `undefined` means the framework has no opinion, so a provider that detects a terminal itself
|
|
26
|
+
* keeps deciding - which is why the pino path forwards nothing in that case.
|
|
27
|
+
*/
|
|
28
|
+
static resolveColorize(opts?: {
|
|
29
|
+
configured?: string;
|
|
30
|
+
environment?: string;
|
|
31
|
+
}): boolean | undefined;
|
|
32
|
+
}
|
|
32
33
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAmC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa;CAGtD;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAmC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa;CAGtD;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC;AAG9D,qBAAa,mBAAmB;IAC9B,mPAAmP;IACnP,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAsB7D;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE;QAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,GAAG,SAAS;CAkBxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Environment } from '../../env/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ParseUtility } from '../../../utilities/parse.utility.js';
|
|
3
3
|
import { LogLevels } from './types.js';
|
|
4
4
|
// -------------------------------------------------------------
|
|
5
5
|
export class LoggerFormats {
|
|
@@ -11,51 +11,48 @@ export class LoggerFormats {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
// -------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
export class LoggerConfigUtility {
|
|
15
|
+
/** The logger's own level, below which a line never reaches ANY transport. Defaults to `debug` - level gating belongs to the wrapper and each transport, and a stricter default here would silently drop lines the wrapper already let through. */
|
|
16
|
+
static resolveLevel(opts) {
|
|
17
|
+
const { configured } = opts;
|
|
18
|
+
if (!configured || configured.trim() === '') {
|
|
19
|
+
return LogLevels.DEBUG;
|
|
20
|
+
}
|
|
21
|
+
const normalized = configured.trim().toLowerCase();
|
|
22
|
+
if (!LogLevels.isValid(normalized)) {
|
|
23
|
+
// console, not Logger: the logger is being built - routing this warning through it would re-enter the very pipeline that is not configured yet.
|
|
24
|
+
console.warn('[resolveLoggerLevel] Invalid logger level | value: %s | valids: %s | fallback: %s', configured, [...LogLevels.SCHEME_SET], LogLevels.DEBUG);
|
|
25
|
+
return LogLevels.DEBUG;
|
|
26
|
+
}
|
|
27
|
+
return normalized;
|
|
24
28
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Whether log lines may carry ANSI color, resolved at CALL time. First match wins:
|
|
31
|
+
*
|
|
32
|
+
* 1. `APP_ENV_LOGGER_COLOR` - an explicit yes or no from the operator.
|
|
33
|
+
* 2. `NO_COLOR`, set to anything non-empty - the no-color.org convention.
|
|
34
|
+
* 3. `NODE_ENV` outside {@link Environment.DEVELOPMENT_ENVS} - production, staging, uat and any
|
|
35
|
+
* unrecognized name. Fail-closed, the same boundary the error sanitizer draws: colors are a
|
|
36
|
+
* terminal affordance, and in a deployed environment the same bytes land in a file or an
|
|
37
|
+
* aggregator as escape noise every grep then has to strip.
|
|
38
|
+
*
|
|
39
|
+
* `undefined` means the framework has no opinion, so a provider that detects a terminal itself
|
|
40
|
+
* keeps deciding - which is why the pino path forwards nothing in that case.
|
|
41
|
+
*/
|
|
42
|
+
static resolveColorize(opts) {
|
|
43
|
+
const configured = opts?.configured ?? process.env.APP_ENV_LOGGER_COLOR;
|
|
44
|
+
if (configured !== undefined && configured.trim() !== '') {
|
|
45
|
+
return ParseUtility.toBoolean({ input: configured.trim().toLowerCase() });
|
|
46
|
+
}
|
|
47
|
+
const noColor = process.env.NO_COLOR;
|
|
48
|
+
if (noColor !== undefined && noColor !== '') {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const environment = opts?.environment ?? Environment.current;
|
|
52
|
+
if (!Environment.DEVELOPMENT_ENVS.has(environment)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
30
56
|
}
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Whether log lines may carry ANSI color, resolved at CALL time. First match wins:
|
|
35
|
-
*
|
|
36
|
-
* 1. `APP_ENV_LOGGER_COLOR` - an explicit yes or no from the operator.
|
|
37
|
-
* 2. `NO_COLOR`, set to anything non-empty - the no-color.org convention.
|
|
38
|
-
* 3. `NODE_ENV` outside {@link Environment.DEVELOPMENT_ENVS} - production, staging, uat and any
|
|
39
|
-
* unrecognized name. Fail-closed, the same boundary the error sanitizer draws: colors are a
|
|
40
|
-
* terminal affordance, and in a deployed environment the same bytes land in a file or an
|
|
41
|
-
* aggregator as escape noise every grep then has to strip.
|
|
42
|
-
*
|
|
43
|
-
* `undefined` means the framework has no opinion, so a provider that detects a terminal itself
|
|
44
|
-
* keeps deciding - which is why the pino path forwards nothing in that case.
|
|
45
|
-
*/
|
|
46
|
-
export const resolveLoggerColorize = (opts) => {
|
|
47
|
-
const configured = opts?.configured ?? process.env.APP_ENV_LOGGER_COLOR;
|
|
48
|
-
if (configured !== undefined && configured.trim() !== '') {
|
|
49
|
-
return toBoolean(configured.trim().toLowerCase());
|
|
50
|
-
}
|
|
51
|
-
const noColor = process.env.NO_COLOR;
|
|
52
|
-
if (noColor !== undefined && noColor !== '') {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
const environment = opts?.environment ?? Environment.current;
|
|
56
|
-
if (!Environment.DEVELOPMENT_ENVS.has(environment)) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
return undefined;
|
|
60
|
-
};
|
|
57
|
+
}
|
|
61
58
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAkB,MAAM,SAAS,CAAC;AAEpD,gEAAgE;AAChE,MAAM,OAAO,aAAa;aACR,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAKH,gEAAgE;AAChE,MAAM,OAAO,mBAAmB;IAC9B,mPAAmP;IACnP,MAAM,CAAC,YAAY,CAAC,IAA6B;QAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAE5B,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC5C,OAAO,SAAS,CAAC,KAAK,CAAC;QACzB,CAAC;QAED,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACnC,gJAAgJ;YAChJ,OAAO,CAAC,IAAI,CACV,mFAAmF,EACnF,UAAU,EACV,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,EACzB,SAAS,CAAC,KAAK,CAChB,CAAC;YACF,OAAO,SAAS,CAAC,KAAK,CAAC;QACzB,CAAC;QAED,OAAO,UAAuB,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,eAAe,CAAC,IAGtB;QACC,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACxE,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACzD,OAAO,YAAY,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QACrC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,EAAE,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC;QAC7D,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["import { type TConstValue } from '@/common/types';\nimport { Environment } from '@/modules/env';\nimport { ParseUtility } from '@/utilities/parse.utility';\nimport { LogLevels, type TLogLevel } from './types';\n\n// -------------------------------------------------------------\nexport class LoggerFormats {\n static readonly JSON = 'json';\n static readonly TEXT = 'text';\n\n static readonly SCHEME_SET = new Set([this.JSON, this.TEXT]);\n\n static isValid(input: string): input is TLoggerFormat {\n return this.SCHEME_SET.has(input);\n }\n}\n\nexport type TLoggerFormat = TConstValue<typeof LoggerFormats>;\n\n// -------------------------------------------------------------\nexport class LoggerConfigUtility {\n /** The logger's own level, below which a line never reaches ANY transport. Defaults to `debug` - level gating belongs to the wrapper and each transport, and a stricter default here would silently drop lines the wrapper already let through. */\n static resolveLevel(opts: { configured?: string }): TLogLevel {\n const { configured } = opts;\n\n if (!configured || configured.trim() === '') {\n return LogLevels.DEBUG;\n }\n\n const normalized = configured.trim().toLowerCase();\n if (!LogLevels.isValid(normalized)) {\n // console, not Logger: the logger is being built - routing this warning through it would re-enter the very pipeline that is not configured yet.\n console.warn(\n '[resolveLoggerLevel] Invalid logger level | value: %s | valids: %s | fallback: %s',\n configured,\n [...LogLevels.SCHEME_SET],\n LogLevels.DEBUG,\n );\n return LogLevels.DEBUG;\n }\n\n return normalized as TLogLevel;\n }\n\n /**\n * Whether log lines may carry ANSI color, resolved at CALL time. First match wins:\n *\n * 1. `APP_ENV_LOGGER_COLOR` - an explicit yes or no from the operator.\n * 2. `NO_COLOR`, set to anything non-empty - the no-color.org convention.\n * 3. `NODE_ENV` outside {@link Environment.DEVELOPMENT_ENVS} - production, staging, uat and any\n * unrecognized name. Fail-closed, the same boundary the error sanitizer draws: colors are a\n * terminal affordance, and in a deployed environment the same bytes land in a file or an\n * aggregator as escape noise every grep then has to strip.\n *\n * `undefined` means the framework has no opinion, so a provider that detects a terminal itself\n * keeps deciding - which is why the pino path forwards nothing in that case.\n */\n static resolveColorize(opts?: {\n configured?: string;\n environment?: string;\n }): boolean | undefined {\n const configured = opts?.configured ?? process.env.APP_ENV_LOGGER_COLOR;\n if (configured !== undefined && configured.trim() !== '') {\n return ParseUtility.toBoolean({ input: configured.trim().toLowerCase() });\n }\n\n const noColor = process.env.NO_COLOR;\n if (noColor !== undefined && noColor !== '') {\n return false;\n }\n\n const environment = opts?.environment ?? Environment.current;\n if (!Environment.DEVELOPMENT_ENVS.has(environment)) {\n return false;\n }\n\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type TEnvironment = Record<string, string | undefined>;
|
|
2
|
+
/**
|
|
3
|
+
* The rule that decides whether `debug` lines are written: off unless `DEBUG` is truthy and the environment is allowed
|
|
4
|
+
* (`NODE_ENV` unset, or one of the common names, or one `APP_ENV_EXTRA_LOG_ENVS` adds). Every provider shares it, so a
|
|
5
|
+
* console, a winston and a pino logger agree.
|
|
6
|
+
*
|
|
7
|
+
* Pure: it takes the environment as an argument and reads `process` only through a guarded `globalThis` read, because a
|
|
8
|
+
* browser has none and there the default is off. `LoggerFactory.use({ level })` overrides it.
|
|
9
|
+
*/
|
|
10
|
+
export declare class LoggerDebugGate {
|
|
11
|
+
/** The override lives on globalThis, so `use({ level })` in one copy of the module opens or closes debug in the other. */
|
|
12
|
+
private static readonly FORCED_SLOT;
|
|
13
|
+
private static resolved?;
|
|
14
|
+
/** The environment the host has, `{}` where there is no `process`. */
|
|
15
|
+
static readEnvironment(): TEnvironment;
|
|
16
|
+
/**
|
|
17
|
+
* The truthiness `ParseUtility.toBoolean` has, repeated here on purpose: `ParseUtility` imports the error module, and
|
|
18
|
+
* this file is in the graph of `BaseHelper`, which must stay a few hundred bytes in a browser bundle.
|
|
19
|
+
*/
|
|
20
|
+
private static isTruthy;
|
|
21
|
+
/** The rule itself, for any environment: a pure function of `env`. */
|
|
22
|
+
static evaluate(opts: {
|
|
23
|
+
env: TEnvironment;
|
|
24
|
+
}): boolean;
|
|
25
|
+
/** Whether `debug` is written now: the override when `use` set one, else the rule on the host's environment, read once. */
|
|
26
|
+
static isOpen(): boolean;
|
|
27
|
+
/** `LoggerFactory.use({ level })` calls it: an explicit level turns debug on or off whatever the environment says. */
|
|
28
|
+
static force(opts: {
|
|
29
|
+
isOpen: boolean | undefined;
|
|
30
|
+
}): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=debug-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-gate.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/debug-gate.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACH,qBAAa,eAAe;IAC1B,0HAA0H;IAC1H,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAA2C;IAC9E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAU;IAElC,sEAAsE;IACtE,MAAM,CAAC,eAAe,IAAI,YAAY;IAItC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ;IAKvB,sEAAsE;IACtE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,YAAY,CAAA;KAAE,GAAG,OAAO;IASrD,2HAA2H;IAC3H,MAAM,CAAC,MAAM,IAAI,OAAO;IAUxB,sHAAsH;IACtH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,GAAG,IAAI;CAQ1D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EnvironmentNames } from '../../env/names.js';
|
|
2
|
+
/**
|
|
3
|
+
* The rule that decides whether `debug` lines are written: off unless `DEBUG` is truthy and the environment is allowed
|
|
4
|
+
* (`NODE_ENV` unset, or one of the common names, or one `APP_ENV_EXTRA_LOG_ENVS` adds). Every provider shares it, so a
|
|
5
|
+
* console, a winston and a pino logger agree.
|
|
6
|
+
*
|
|
7
|
+
* Pure: it takes the environment as an argument and reads `process` only through a guarded `globalThis` read, because a
|
|
8
|
+
* browser has none and there the default is off. `LoggerFactory.use({ level })` overrides it.
|
|
9
|
+
*/
|
|
10
|
+
export class LoggerDebugGate {
|
|
11
|
+
/** The override lives on globalThis, so `use({ level })` in one copy of the module opens or closes debug in the other. */
|
|
12
|
+
static { this.FORCED_SLOT = Symbol.for('ignis:logger-debug-forced'); }
|
|
13
|
+
/** The environment the host has, `{}` where there is no `process`. */
|
|
14
|
+
static readEnvironment() {
|
|
15
|
+
return globalThis.process?.env ?? {};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The truthiness `ParseUtility.toBoolean` has, repeated here on purpose: `ParseUtility` imports the error module, and
|
|
19
|
+
* this file is in the graph of `BaseHelper`, which must stay a few hundred bytes in a browser bundle.
|
|
20
|
+
*/
|
|
21
|
+
static isTruthy(opts) {
|
|
22
|
+
const { input } = opts;
|
|
23
|
+
return input !== undefined && input !== '' && input !== 'false' && input !== '0';
|
|
24
|
+
}
|
|
25
|
+
/** The rule itself, for any environment: a pure function of `env`. */
|
|
26
|
+
static evaluate(opts) {
|
|
27
|
+
const { env } = opts;
|
|
28
|
+
const { DEBUG, NODE_ENV, APP_ENV_EXTRA_LOG_ENVS } = env;
|
|
29
|
+
const extra = (APP_ENV_EXTRA_LOG_ENVS ?? '').split(',').map((name) => name.trim());
|
|
30
|
+
const allowed = new Set([...Array.from(EnvironmentNames.COMMON_ENVS), ...extra]);
|
|
31
|
+
return this.isTruthy({ input: DEBUG }) && (!NODE_ENV || allowed.has(NODE_ENV));
|
|
32
|
+
}
|
|
33
|
+
/** Whether `debug` is written now: the override when `use` set one, else the rule on the host's environment, read once. */
|
|
34
|
+
static isOpen() {
|
|
35
|
+
const forced = Reflect.get(globalThis, this.FORCED_SLOT);
|
|
36
|
+
if (forced !== undefined) {
|
|
37
|
+
return forced;
|
|
38
|
+
}
|
|
39
|
+
this.resolved ??= this.evaluate({ env: this.readEnvironment() });
|
|
40
|
+
return this.resolved;
|
|
41
|
+
}
|
|
42
|
+
/** `LoggerFactory.use({ level })` calls it: an explicit level turns debug on or off whatever the environment says. */
|
|
43
|
+
static force(opts) {
|
|
44
|
+
if (opts.isOpen === undefined) {
|
|
45
|
+
Reflect.deleteProperty(globalThis, this.FORCED_SLOT);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
Reflect.set(globalThis, this.FORCED_SLOT, opts.isOpen);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=debug-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-gate.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/debug-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAC1B,0HAA0H;aAClG,gBAAW,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAG9E,sEAAsE;IACtE,MAAM,CAAC,eAAe;QACpB,OAAO,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IACvC,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,QAAQ,CAAC,IAAmC;QACzD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,GAAG,CAAC;IACnF,CAAC;IAED,sEAAsE;IACtE,MAAM,CAAC,QAAQ,CAAC,IAA2B;QACzC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,GAAG,GAAG,CAAC;QACxD,MAAM,KAAK,GAAG,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;QAEjF,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,2HAA2H;IAC3H,MAAM,CAAC,MAAM;QACX,MAAM,MAAM,GAAwB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,sHAAsH;IACtH,MAAM,CAAC,KAAK,CAAC,IAAqC;QAChD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC","sourcesContent":["import { EnvironmentNames } from '@/modules/env/names';\n\ntype TEnvironment = Record<string, string | undefined>;\n\n/**\n * The rule that decides whether `debug` lines are written: off unless `DEBUG` is truthy and the environment is allowed\n * (`NODE_ENV` unset, or one of the common names, or one `APP_ENV_EXTRA_LOG_ENVS` adds). Every provider shares it, so a\n * console, a winston and a pino logger agree.\n *\n * Pure: it takes the environment as an argument and reads `process` only through a guarded `globalThis` read, because a\n * browser has none and there the default is off. `LoggerFactory.use({ level })` overrides it.\n */\nexport class LoggerDebugGate {\n /** The override lives on globalThis, so `use({ level })` in one copy of the module opens or closes debug in the other. */\n private static readonly FORCED_SLOT = Symbol.for('ignis:logger-debug-forced');\n private static resolved?: boolean;\n\n /** The environment the host has, `{}` where there is no `process`. */\n static readEnvironment(): TEnvironment {\n return globalThis.process?.env ?? {};\n }\n\n /**\n * The truthiness `ParseUtility.toBoolean` has, repeated here on purpose: `ParseUtility` imports the error module, and\n * this file is in the graph of `BaseHelper`, which must stay a few hundred bytes in a browser bundle.\n */\n private static isTruthy(opts: { input: string | undefined }): boolean {\n const { input } = opts;\n return input !== undefined && input !== '' && input !== 'false' && input !== '0';\n }\n\n /** The rule itself, for any environment: a pure function of `env`. */\n static evaluate(opts: { env: TEnvironment }): boolean {\n const { env } = opts;\n const { DEBUG, NODE_ENV, APP_ENV_EXTRA_LOG_ENVS } = env;\n const extra = (APP_ENV_EXTRA_LOG_ENVS ?? '').split(',').map((name) => name.trim());\n const allowed = new Set([...Array.from(EnvironmentNames.COMMON_ENVS), ...extra]);\n\n return this.isTruthy({ input: DEBUG }) && (!NODE_ENV || allowed.has(NODE_ENV));\n }\n\n /** Whether `debug` is written now: the override when `use` set one, else the rule on the host's environment, read once. */\n static isOpen(): boolean {\n const forced: boolean | undefined = Reflect.get(globalThis, this.FORCED_SLOT);\n if (forced !== undefined) {\n return forced;\n }\n\n this.resolved ??= this.evaluate({ env: this.readEnvironment() });\n return this.resolved;\n }\n\n /** `LoggerFactory.use({ level })` calls it: an explicit level turns debug on or off whatever the environment says. */\n static force(opts: { isOpen: boolean | undefined }): void {\n if (opts.isOpen === undefined) {\n Reflect.deleteProperty(globalThis, this.FORCED_SLOT);\n return;\n }\n\n Reflect.set(globalThis, this.FORCED_SLOT, opts.isOpen);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC","sourcesContent":["export * from './constants';\nexport * from './debug-gate';\nexport * from './types';\n"]}
|
|
@@ -6,7 +6,14 @@ export declare class LogLevels {
|
|
|
6
6
|
static readonly INFO = "info";
|
|
7
7
|
static readonly DEBUG = "debug";
|
|
8
8
|
static readonly SCHEME_SET: Set<string>;
|
|
9
|
+
/** From the most to the least severe: a threshold lets through its own level and every level before it. */
|
|
10
|
+
static readonly ORDER: ReadonlyArray<string>;
|
|
9
11
|
static isValid(input: string): boolean;
|
|
12
|
+
/** Whether a line of `level` passes a `threshold`: `debug` lets everything through, `error` only `error` and `emerg`. */
|
|
13
|
+
static isEnabled(opts: {
|
|
14
|
+
level: string;
|
|
15
|
+
threshold: string;
|
|
16
|
+
}): boolean;
|
|
10
17
|
}
|
|
11
18
|
export type TLogLevel = TConstValue<typeof LogLevels>;
|
|
12
19
|
/** The logging contract every consumer types against; which provider produced the logger is invisible behind it - only `factory.ts` and a provider's back-compat aliases may name a concrete logger class. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhE,qBAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAuE;IAEjG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/logger/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhE,qBAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAuE;IAEjG,2GAA2G;IAC3G,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAM1C;IAEF,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAItC,yHAAyH;IACzH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;CAQtE;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC,CAAC;AAEtD,8MAA8M;AAC9M,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjE,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,8FAA8F;AAC9F,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B"}
|
|
@@ -5,8 +5,24 @@ export class LogLevels {
|
|
|
5
5
|
static { this.INFO = 'info'; }
|
|
6
6
|
static { this.DEBUG = 'debug'; }
|
|
7
7
|
static { this.SCHEME_SET = new Set([this.ERROR, this.EMERG, this.WARN, this.INFO, this.DEBUG]); }
|
|
8
|
+
/** From the most to the least severe: a threshold lets through its own level and every level before it. */
|
|
9
|
+
static { this.ORDER = [
|
|
10
|
+
this.EMERG,
|
|
11
|
+
this.ERROR,
|
|
12
|
+
this.WARN,
|
|
13
|
+
this.INFO,
|
|
14
|
+
this.DEBUG,
|
|
15
|
+
]; }
|
|
8
16
|
static isValid(input) {
|
|
9
17
|
return this.SCHEME_SET.has(input);
|
|
10
18
|
}
|
|
19
|
+
/** Whether a line of `level` passes a `threshold`: `debug` lets everything through, `error` only `error` and `emerg`. */
|
|
20
|
+
static isEnabled(opts) {
|
|
21
|
+
const { level, threshold } = opts;
|
|
22
|
+
const levelRank = this.ORDER.indexOf(level);
|
|
23
|
+
const thresholdRank = this.ORDER.indexOf(threshold);
|
|
24
|
+
// An unknown level or threshold is never silenced: a typo must not hide a line.
|
|
25
|
+
return levelRank < 0 || thresholdRank < 0 || levelRank <= thresholdRank;
|
|
26
|
+
}
|
|
11
27
|
}
|
|
12
28
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/types.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;aACJ,UAAK,GAAG,OAAO,CAAC;aAChB,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAEjG,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC","sourcesContent":["import { type AnyType, type TConstValue } from '@/common/types';\n\nexport class LogLevels {\n static readonly ERROR = 'error';\n static readonly EMERG = 'emerg';\n static readonly WARN = 'warn';\n static readonly INFO = 'info';\n static readonly DEBUG = 'debug';\n\n static readonly SCHEME_SET = new Set([this.ERROR, this.EMERG, this.WARN, this.INFO, this.DEBUG]);\n\n static isValid(input: string): boolean {\n return this.SCHEME_SET.has(input);\n }\n}\n\nexport type TLogLevel = TConstValue<typeof LogLevels>;\n\n/** The logging contract every consumer types against; which provider produced the logger is invisible behind it - only `factory.ts` and a provider's back-compat aliases may name a concrete logger class. */\nexport interface ILogger {\n debug(message: string, ...args: AnyType[]): void;\n info(message: string, ...args: AnyType[]): void;\n warn(message: string, ...args: AnyType[]): void;\n error(message: string, ...args: AnyType[]): void;\n emerg(message: string, ...args: AnyType[]): void;\n log(level: TLogLevel, message: string, ...args: AnyType[]): void;\n for(methodName: string): ILogger;\n}\n\n/** Static-side contract a provider class satisfies - WinstonLogger and PinoLogger both do. */\nexport interface ILoggerProvider {\n get(scope: string): ILogger;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/modules/logger/common/types.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAS;aACJ,UAAK,GAAG,OAAO,CAAC;aAChB,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAEjG,2GAA2G;aAC3F,UAAK,GAA0B;QAC7C,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;KACX,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,yHAAyH;IACzH,MAAM,CAAC,SAAS,CAAC,IAA0C;QACzD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEpD,gFAAgF;QAChF,OAAO,SAAS,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC,IAAI,SAAS,IAAI,aAAa,CAAC;IAC1E,CAAC","sourcesContent":["import { type AnyType, type TConstValue } from '@/common/types';\n\nexport class LogLevels {\n static readonly ERROR = 'error';\n static readonly EMERG = 'emerg';\n static readonly WARN = 'warn';\n static readonly INFO = 'info';\n static readonly DEBUG = 'debug';\n\n static readonly SCHEME_SET = new Set([this.ERROR, this.EMERG, this.WARN, this.INFO, this.DEBUG]);\n\n /** From the most to the least severe: a threshold lets through its own level and every level before it. */\n static readonly ORDER: ReadonlyArray<string> = [\n this.EMERG,\n this.ERROR,\n this.WARN,\n this.INFO,\n this.DEBUG,\n ];\n\n static isValid(input: string): boolean {\n return this.SCHEME_SET.has(input);\n }\n\n /** Whether a line of `level` passes a `threshold`: `debug` lets everything through, `error` only `error` and `emerg`. */\n static isEnabled(opts: { level: string; threshold: string }): boolean {\n const { level, threshold } = opts;\n const levelRank = this.ORDER.indexOf(level);\n const thresholdRank = this.ORDER.indexOf(threshold);\n\n // An unknown level or threshold is never silenced: a typo must not hide a line.\n return levelRank < 0 || thresholdRank < 0 || levelRank <= thresholdRank;\n }\n}\n\nexport type TLogLevel = TConstValue<typeof LogLevels>;\n\n/** The logging contract every consumer types against; which provider produced the logger is invisible behind it - only `factory.ts` and a provider's back-compat aliases may name a concrete logger class. */\nexport interface ILogger {\n debug(message: string, ...args: AnyType[]): void;\n info(message: string, ...args: AnyType[]): void;\n warn(message: string, ...args: AnyType[]): void;\n error(message: string, ...args: AnyType[]): void;\n emerg(message: string, ...args: AnyType[]): void;\n log(level: TLogLevel, message: string, ...args: AnyType[]): void;\n for(methodName: string): ILogger;\n}\n\n/** Static-side contract a provider class satisfies - WinstonLogger and PinoLogger both do. */\nexport interface ILoggerProvider {\n get(scope: string): ILogger;\n}\n"]}
|
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import { type ILogger, type ILoggerProvider } from './common/types.js';
|
|
2
|
-
/**
|
|
1
|
+
import { type ILogger, type ILoggerProvider, type TLogLevel } from './common/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The one way to get a logger, and the same everywhere: the server, a script and a browser. It names no provider: the
|
|
4
|
+
* default is the console (`ConsoleLogger`), and an application chooses another with `use()`. It imports nothing from
|
|
5
|
+
* node, so it is part of the browser-pure `core` entry.
|
|
6
|
+
*/
|
|
3
7
|
export declare class LoggerFactory {
|
|
4
|
-
private static provider?;
|
|
5
8
|
private static cache;
|
|
6
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Choose the application's provider and/or the level. A provider re-points every wrapper issued so far. The level
|
|
11
|
+
* (a `LogLevels` value the application passes) is applied by the wrapper to every provider alike, and it also
|
|
12
|
+
* decides whether `debug` lines are written at all: `debug` turns the gate on, anything above it turns it off,
|
|
13
|
+
* whatever the environment says. A level that is not a `LogLevels` value (a typo, an uppercase name from the
|
|
14
|
+
* environment) is ignored: it must never open debug.
|
|
15
|
+
*/
|
|
7
16
|
static use(opts: {
|
|
17
|
+
provider?: ILoggerProvider;
|
|
18
|
+
level?: TLogLevel;
|
|
19
|
+
}): void;
|
|
20
|
+
/** Choose `provider` only when the application has not chosen one: a framework's startup default, never an override. */
|
|
21
|
+
static useUnlessChosen(opts: {
|
|
8
22
|
provider: ILoggerProvider;
|
|
9
23
|
}): void;
|
|
24
|
+
/** Whether an application (or a framework default through `useUnlessChosen`) has chosen a provider. */
|
|
25
|
+
static isChosen(): boolean;
|
|
26
|
+
/** The slot is the only record of the choice, so a `use()` or a `reset()` in any copy of the module is seen by all. */
|
|
10
27
|
static currentProvider(): ILoggerProvider;
|
|
11
|
-
/**
|
|
28
|
+
/** Moves whenever a provider is chosen or reset, in any copy: a wrapper that cached its logger takes it again. */
|
|
29
|
+
static currentGeneration(): number;
|
|
30
|
+
private static bumpGeneration;
|
|
31
|
+
/** The level the application set, or `undefined`: then every provider applies its own gate. */
|
|
32
|
+
static currentLevel(): TLogLevel | undefined;
|
|
33
|
+
/** The provider chosen by any copy of this module, if any. */
|
|
12
34
|
private static sharedProvider;
|
|
13
|
-
|
|
35
|
+
/** Back to the default provider and no level, and every wrapper takes the console again: for a test, or a host that starts over. */
|
|
36
|
+
static reset(): void;
|
|
14
37
|
static getLogger(scopes: string[]): ILogger;
|
|
15
38
|
}
|
|
16
|
-
/** Provider-following facade: always resolves through the registered provider. */
|
|
17
|
-
export declare const ApplicationLogger: {
|
|
18
|
-
get: (scope: string) => ILogger;
|
|
19
|
-
};
|
|
20
39
|
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/modules/logger/factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/modules/logger/factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkG/F;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAsC;IAE1D;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,eAAe,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,IAAI;IAqBzE,wHAAwH;IACxH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,eAAe,CAAA;KAAE,GAAG,IAAI;IAMjE,uGAAuG;IACvG,MAAM,CAAC,QAAQ,IAAI,OAAO;IAI1B,uHAAuH;IACvH,MAAM,CAAC,eAAe,IAAI,eAAe;IAIzC,kHAAkH;IAClH,MAAM,CAAC,iBAAiB,IAAI,MAAM;IAKlC,OAAO,CAAC,MAAM,CAAC,cAAc;IAI7B,+FAA+F;IAC/F,MAAM,CAAC,YAAY,IAAI,SAAS,GAAG,SAAS;IAK5C,8DAA8D;IAC9D,OAAO,CAAC,MAAM,CAAC,cAAc;IAK7B,oIAAoI;IACpI,MAAM,CAAC,KAAK,IAAI,IAAI;IAUpB,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO;CAW5C"}
|