@loglayer/shared
Advanced tools
+1
-0
@@ -0,1 +1,2 @@ | ||
| Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
@@ -2,0 +3,0 @@ //#region src/common.types.ts |
+97
-1
@@ -200,2 +200,26 @@ //#region src/lazy.d.ts | ||
| type LogReturnType<IsAsync extends boolean> = IsAsync extends true ? Promise<void> : IsAsync extends false ? void : void | Promise<void>; | ||
| /** | ||
| * Configuration for a single log group. | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| interface LogGroupConfig { | ||
| /** | ||
| * Array of transport IDs that this group routes to. | ||
| */ | ||
| transports: string[]; | ||
| /** | ||
| * Minimum log level for this group. Logs below this level are dropped | ||
| * for this group's transports. Default is "trace" (all levels pass). | ||
| */ | ||
| level?: LogLevelType; | ||
| /** | ||
| * Whether this group is enabled. Default is true. | ||
| */ | ||
| enabled?: boolean; | ||
| } | ||
| /** | ||
| * Map of group names to their configurations. | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| type LogGroupsConfig = Record<string, LogGroupConfig>; | ||
| interface LogLayerCommonDataParams { | ||
@@ -263,2 +287,8 @@ /** | ||
| logLevel: LogLevelType; | ||
| /** | ||
| * The group names this log entry belongs to, if any. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| groups?: string[]; | ||
| } | ||
@@ -584,2 +614,8 @@ /** | ||
| hasData?: boolean; | ||
| /** | ||
| * The group names this log entry belongs to, if any. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| groups?: string[]; | ||
| } | ||
@@ -669,2 +705,8 @@ /** | ||
| /** | ||
| * Tags this log entry with one or more groups for routing. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| withGroup(group: string | string[]): ILogBuilder<This, IsAsync>; | ||
| /** | ||
| * Enable sending logs to the logging library. | ||
@@ -743,2 +785,53 @@ * | ||
| /** | ||
| * Creates a child logger with the specified group(s) persistently assigned. | ||
| * All logs from the child will be tagged with these groups. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| withGroup(group: string | string[]): This; | ||
| /** | ||
| * Adds a new group definition at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| addGroup(name: string, config: LogGroupConfig): This; | ||
| /** | ||
| * Removes a group definition at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| removeGroup(name: string): This; | ||
| /** | ||
| * Enables a group by name (sets enabled: true). | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| enableGroup(name: string): This; | ||
| /** | ||
| * Disables a group by name (sets enabled: false). Logs tagged with a disabled | ||
| * group will not be routed through that group. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| disableGroup(name: string): This; | ||
| /** | ||
| * Sets the minimum log level for a group at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| setGroupLevel(name: string, level: LogLevelType): This; | ||
| /** | ||
| * Sets which groups are active. Only active groups will route logs. | ||
| * Pass null to clear the filter (all groups active). | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| setActiveGroups(groups: string[] | null): This; | ||
| /** | ||
| * Returns a snapshot of all group configurations. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| getGroups(): LogGroupsConfig; | ||
| /** | ||
| * Appends context data which will be included with | ||
@@ -946,2 +1039,5 @@ * every log entry. | ||
| muteMetadata?: boolean; | ||
| groups?: LogGroupsConfig; | ||
| activeGroups?: string[] | null; | ||
| ungroupedBehavior?: "all" | "none" | string[]; | ||
| }; | ||
@@ -965,2 +1061,2 @@ /** | ||
| //#endregion | ||
| export { ContainsAsyncLazy, ErrorOnlyOpts, IContextManager, ILogBuilder, ILogLayer, ILogLevelManager, LAZY_EVAL_ERROR, LAZY_SYMBOL, LazyEvalFailure, LazyLogValue, LogLayerCommonDataParams, LogLayerContext, LogLayerData, LogLayerMetadata, LogLayerPlugin, LogLayerPluginParams, LogLayerTransport, LogLayerTransportParams, LogLevel, LogLevelPriority, LogLevelPriorityToNames, LogLevelType, LogReturnType, MessageDataType, OnChildLogLevelManagerCreatedParams, OnChildLoggerCreatedParams, PluginBeforeDataOutParams, PluginBeforeMessageOutParams, PluginShouldSendToLoggerParams, PluginTransformLogLevelParams, RawLogEntry, ResolveLazyResult, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues }; | ||
| export { ContainsAsyncLazy, ErrorOnlyOpts, IContextManager, ILogBuilder, ILogLayer, ILogLevelManager, LAZY_EVAL_ERROR, LAZY_SYMBOL, LazyEvalFailure, LazyLogValue, LogGroupConfig, LogGroupsConfig, LogLayerCommonDataParams, LogLayerContext, LogLayerData, LogLayerMetadata, LogLayerPlugin, LogLayerPluginParams, LogLayerTransport, LogLayerTransportParams, LogLevel, LogLevelPriority, LogLevelPriorityToNames, LogLevelType, LogReturnType, MessageDataType, OnChildLogLevelManagerCreatedParams, OnChildLoggerCreatedParams, PluginBeforeDataOutParams, PluginBeforeMessageOutParams, PluginShouldSendToLoggerParams, PluginTransformLogLevelParams, RawLogEntry, ResolveLazyResult, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues }; |
+97
-1
@@ -200,2 +200,26 @@ //#region src/lazy.d.ts | ||
| type LogReturnType<IsAsync extends boolean> = IsAsync extends true ? Promise<void> : IsAsync extends false ? void : void | Promise<void>; | ||
| /** | ||
| * Configuration for a single log group. | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| interface LogGroupConfig { | ||
| /** | ||
| * Array of transport IDs that this group routes to. | ||
| */ | ||
| transports: string[]; | ||
| /** | ||
| * Minimum log level for this group. Logs below this level are dropped | ||
| * for this group's transports. Default is "trace" (all levels pass). | ||
| */ | ||
| level?: LogLevelType; | ||
| /** | ||
| * Whether this group is enabled. Default is true. | ||
| */ | ||
| enabled?: boolean; | ||
| } | ||
| /** | ||
| * Map of group names to their configurations. | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| type LogGroupsConfig = Record<string, LogGroupConfig>; | ||
| interface LogLayerCommonDataParams { | ||
@@ -263,2 +287,8 @@ /** | ||
| logLevel: LogLevelType; | ||
| /** | ||
| * The group names this log entry belongs to, if any. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| groups?: string[]; | ||
| } | ||
@@ -584,2 +614,8 @@ /** | ||
| hasData?: boolean; | ||
| /** | ||
| * The group names this log entry belongs to, if any. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| groups?: string[]; | ||
| } | ||
@@ -669,2 +705,8 @@ /** | ||
| /** | ||
| * Tags this log entry with one or more groups for routing. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| withGroup(group: string | string[]): ILogBuilder<This, IsAsync>; | ||
| /** | ||
| * Enable sending logs to the logging library. | ||
@@ -743,2 +785,53 @@ * | ||
| /** | ||
| * Creates a child logger with the specified group(s) persistently assigned. | ||
| * All logs from the child will be tagged with these groups. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| withGroup(group: string | string[]): This; | ||
| /** | ||
| * Adds a new group definition at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| addGroup(name: string, config: LogGroupConfig): This; | ||
| /** | ||
| * Removes a group definition at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| removeGroup(name: string): This; | ||
| /** | ||
| * Enables a group by name (sets enabled: true). | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| enableGroup(name: string): This; | ||
| /** | ||
| * Disables a group by name (sets enabled: false). Logs tagged with a disabled | ||
| * group will not be routed through that group. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| disableGroup(name: string): This; | ||
| /** | ||
| * Sets the minimum log level for a group at runtime. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| setGroupLevel(name: string, level: LogLevelType): This; | ||
| /** | ||
| * Sets which groups are active. Only active groups will route logs. | ||
| * Pass null to clear the filter (all groups active). | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| setActiveGroups(groups: string[] | null): This; | ||
| /** | ||
| * Returns a snapshot of all group configurations. | ||
| * | ||
| * @see {@link https://loglayer.dev/logging-api/groups.html | Groups Docs} | ||
| */ | ||
| getGroups(): LogGroupsConfig; | ||
| /** | ||
| * Appends context data which will be included with | ||
@@ -946,2 +1039,5 @@ * every log entry. | ||
| muteMetadata?: boolean; | ||
| groups?: LogGroupsConfig; | ||
| activeGroups?: string[] | null; | ||
| ungroupedBehavior?: "all" | "none" | string[]; | ||
| }; | ||
@@ -965,2 +1061,2 @@ /** | ||
| //#endregion | ||
| export { ContainsAsyncLazy, ErrorOnlyOpts, IContextManager, ILogBuilder, ILogLayer, ILogLevelManager, LAZY_EVAL_ERROR, LAZY_SYMBOL, LazyEvalFailure, LazyLogValue, LogLayerCommonDataParams, LogLayerContext, LogLayerData, LogLayerMetadata, LogLayerPlugin, LogLayerPluginParams, LogLayerTransport, LogLayerTransportParams, LogLevel, LogLevelPriority, LogLevelPriorityToNames, LogLevelType, LogReturnType, MessageDataType, OnChildLogLevelManagerCreatedParams, OnChildLoggerCreatedParams, PluginBeforeDataOutParams, PluginBeforeMessageOutParams, PluginShouldSendToLoggerParams, PluginTransformLogLevelParams, RawLogEntry, ResolveLazyResult, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues }; | ||
| export { ContainsAsyncLazy, ErrorOnlyOpts, IContextManager, ILogBuilder, ILogLayer, ILogLevelManager, LAZY_EVAL_ERROR, LAZY_SYMBOL, LazyEvalFailure, LazyLogValue, LogGroupConfig, LogGroupsConfig, LogLayerCommonDataParams, LogLayerContext, LogLayerData, LogLayerMetadata, LogLayerPlugin, LogLayerPluginParams, LogLayerTransport, LogLayerTransportParams, LogLevel, LogLevelPriority, LogLevelPriorityToNames, LogLevelType, LogReturnType, MessageDataType, OnChildLogLevelManagerCreatedParams, OnChildLoggerCreatedParams, PluginBeforeDataOutParams, PluginBeforeMessageOutParams, PluginShouldSendToLoggerParams, PluginTransformLogLevelParams, RawLogEntry, ResolveLazyResult, countLazyValues, hasPromiseValues, isLazy, lazy, replacePromiseValues, resolveLazyValues, resolvePromiseValues }; |
+3
-3
| { | ||
| "name": "@loglayer/shared", | ||
| "description": "Shared utilities and types for loglayer packages.", | ||
| "version": "4.0.1", | ||
| "version": "4.1.0", | ||
| "type": "module", | ||
@@ -33,4 +33,4 @@ "main": "./dist/index.cjs", | ||
| "devDependencies": { | ||
| "@types/node": "25.2.0", | ||
| "tsdown": "0.20.1", | ||
| "@types/node": "25.2.3", | ||
| "tsdown": "0.20.3", | ||
| "typescript": "5.9.3", | ||
@@ -37,0 +37,0 @@ "vitest": "4.0.18", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
95433
7.18%1463
7.1%11
57.14%