@logtape/config 2.4.0-dev.865 → 2.4.0-dev.868

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/dist/types.d.cts CHANGED
@@ -78,9 +78,11 @@ interface LoggerConfig {
78
78
  */
79
79
  lowestLevel?: LogLevel;
80
80
  /**
81
- * Whether to inherit the parent's sinks.
81
+ * How to combine the logger's sinks with its ancestors' sinks. The
82
+ * `"forward"` mode, available since 2.4.0, inherits ancestors' sinks
83
+ * without applying their `lowestLevel` thresholds.
82
84
  */
83
- parentSinks?: "inherit" | "override";
85
+ parentSinks?: "inherit" | "override" | "forward";
84
86
  }
85
87
  /**
86
88
  * Registry of shorthand mappings.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAMA;;AAIyB,UAJR,aAAA,CAIQ;EAAU;;;EAKjB,KAKN,CAAA,EAVF,MAUE,CAAA,MAAA,EAVa,UAUb,CAAA;EAAY;AAYxB;AAaA;EAWiB,OAAA,CAAA,EAzCL,MAyCK,CAAA,MAAe,EAzCL,YAyCK,CAAA;EAWf;AA+BjB;;EAAkC,OAIxB,CAAA,EAlFE,YAkFF,EAAA;EAAM;;AAUK;EAOJ,KAAA,CAAA,EAAA,OAAA;;;;;AAsB0B;AAe1B,UA5HA,UAAA,CA4HmB;EA6BvB;;;uBArJU;;;;;;;;UASN,YAAA;;;;;;;;;;UAWA,eAAA;;;;;;;;;;UAWA,YAAA;;;;;;;;;;;;;;;;gBAmBD;;;;;;;;;;UAYC,iBAAA;;;;UAIP;;;;YAKE;;;;eAKG;;;;;;UAOE,gBAAA;;;;eAIF;;;;;;;;;;;;;;;;;wBAkBS,oBAAoB;;;;;;;;;;;;;UAe3B,mBAAA;;;;;YAKL;;;;;;;;;;;cAwBC,WAAA,SAAoB,KAAK"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAMA;;AAIyB,UAJR,aAAA,CAIQ;EAAU;;;EAKjB,KAKN,CAAA,EAVF,MAUE,CAAA,MAAA,EAVa,UAUb,CAAA;EAAY;AAYxB;AAaA;EAWiB,OAAA,CAAA,EAzCL,MAyCK,CAAA,MAAe,EAzCL,YAyCK,CAAA;EAWf;AAiCjB;;EAAkC,OAIxB,CAAA,EApFE,YAoFF,EAAA;EAAM;;AAUK;EAOJ,KAAA,CAAA,EAAA,OAAA;;;;;AAsB0B;AAe1B,UA9HA,UAAA,CA8HmB;EA6BvB;;;uBAvJU;;;;;;;;UASN,YAAA;;;;;;;;;;UAWA,eAAA;;;;;;;;;;UAWA,YAAA;;;;;;;;;;;;;;;;gBAmBD;;;;;;;;;;;;UAcC,iBAAA;;;;UAIP;;;;YAKE;;;;eAKG;;;;;;UAOE,gBAAA;;;;eAIF;;;;;;;;;;;;;;;;;wBAkBS,oBAAoB;;;;;;;;;;;;;UAe3B,mBAAA;;;;;YAKL;;;;;;;;;;;cAwBC,WAAA,SAAoB,KAAK"}
package/dist/types.d.ts CHANGED
@@ -78,9 +78,11 @@ interface LoggerConfig {
78
78
  */
79
79
  lowestLevel?: LogLevel;
80
80
  /**
81
- * Whether to inherit the parent's sinks.
81
+ * How to combine the logger's sinks with its ancestors' sinks. The
82
+ * `"forward"` mode, available since 2.4.0, inherits ancestors' sinks
83
+ * without applying their `lowestLevel` thresholds.
82
84
  */
83
- parentSinks?: "inherit" | "override";
85
+ parentSinks?: "inherit" | "override" | "forward";
84
86
  }
85
87
  /**
86
88
  * Registry of shorthand mappings.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAMA;;AAIyB,UAJR,aAAA,CAIQ;EAAU;;;EAKjB,KAKN,CAAA,EAVF,MAUE,CAAA,MAAA,EAVa,UAUb,CAAA;EAAY;AAYxB;AAaA;EAWiB,OAAA,CAAA,EAzCL,MAyCK,CAAA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"version":3,"file":"types.js","names":["message: string"],"sources":["../src/types.ts"],"sourcesContent":["import type { ContextLocalStorage, LogLevel } from \"@logtape/logtape\";\n\n/**\n * Configuration object schema for `configureFromObject()`.\n * @since 2.0.0\n */\nexport interface LogTapeConfig {\n /**\n * The sinks to configure.\n */\n sinks?: Record<string, SinkConfig>;\n\n /**\n * The filters to configure.\n */\n filters?: Record<string, FilterConfig>;\n\n /**\n * The loggers to configure.\n */\n loggers?: LoggerConfig[];\n\n /**\n * Whether to reset the configuration before applying this one.\n */\n reset?: boolean;\n}\n\n/**\n * Sink configuration with module reference.\n * @since 2.0.0\n */\nexport interface SinkConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Formatter configuration or shorthand */\n formatter?: string | FormatterConfig;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Filter configuration with module reference.\n * @since 2.0.0\n */\nexport interface FilterConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Formatter configuration with module reference.\n * @since 2.0.0\n */\nexport interface FormatterConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Logger configuration.\n * @since 2.0.0\n */\nexport interface LoggerConfig {\n /**\n * The category of the logger.\n */\n category: string | string[];\n\n /**\n * The sink identifiers to use.\n */\n sinks?: string[];\n\n /**\n * The filter identifiers to use.\n */\n filters?: string[];\n\n /**\n * The lowest log level to log.\n */\n lowestLevel?: LogLevel;\n\n /**\n * Whether to inherit the parent's sinks.\n */\n parentSinks?: \"inherit\" | \"override\";\n}\n\n/**\n * Registry of shorthand mappings.\n * @since 2.0.0\n */\nexport interface ShorthandRegistry {\n /**\n * The shorthand mappings for sinks.\n */\n sinks?: Record<string, string>;\n\n /**\n * The shorthand mappings for filters.\n */\n filters?: Record<string, string>;\n\n /**\n * The shorthand mappings for formatters.\n */\n formatters?: Record<string, string>;\n}\n\n/**\n * Options for `configureFromObject()`.\n * @since 2.0.0\n */\nexport interface ConfigureOptions {\n /**\n * Custom shorthand mappings to extend or override defaults.\n */\n shorthands?: ShorthandRegistry;\n\n /**\n * The context-local storage to use for implicit contexts.\n *\n * In Node.js, Deno, and Bun, you can use `AsyncLocalStorage` from\n * the `node:async_hooks` module.\n *\n * @example\n * ```typescript\n * import { AsyncLocalStorage } from \"node:async_hooks\";\n * import { configureFromObject } from \"@logtape/config\";\n *\n * await configureFromObject(config, {\n * contextLocalStorage: new AsyncLocalStorage(),\n * });\n * ```\n */\n contextLocalStorage?: ContextLocalStorage<Record<string, unknown>>;\n\n /**\n * How to handle invalid configuration entries.\n *\n * - `\"throw\"` (default): Throw `ConfigError` on any invalid configuration.\n * - `\"warn\"`: Apply only valid parts and log warnings to meta logger.\n */\n onInvalidConfig?: \"throw\" | \"warn\";\n}\n\n/**\n * Options for environment variable expansion.\n * @since 2.0.0\n */\nexport interface EnvExpansionOptions {\n /**\n * Regular expression pattern for matching environment variables.\n * Default: `/\\$\\{([^}:]+)(?::([^}]+))?\\}/g` (matches `${VAR}` or `${VAR:default}`)\n */\n pattern?: RegExp;\n}\n\n/**\n * Parsed module reference.\n * @since 2.0.0\n */\nexport interface ParsedModuleReference {\n /** Whether this is a shorthand (starts with #) */\n isShorthand: boolean;\n /** The shorthand name (if isShorthand is true) */\n shorthandName?: string;\n /** The module path */\n modulePath?: string;\n /** The export name (after #) */\n exportName?: string;\n /** Whether this is a factory function (ends with ()) */\n isFactory: boolean;\n}\n\n/**\n * Error thrown when configuration is invalid.\n * @since 2.0.0\n */\nexport class ConfigError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ConfigError\";\n }\n}\n"],"mappings":";;;;;AAyLA,IAAa,cAAb,cAAiC,MAAM;CACrC,YAAYA,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;CACb;AACF"}
1
+ {"version":3,"file":"types.js","names":["message: string"],"sources":["../src/types.ts"],"sourcesContent":["import type { ContextLocalStorage, LogLevel } from \"@logtape/logtape\";\n\n/**\n * Configuration object schema for `configureFromObject()`.\n * @since 2.0.0\n */\nexport interface LogTapeConfig {\n /**\n * The sinks to configure.\n */\n sinks?: Record<string, SinkConfig>;\n\n /**\n * The filters to configure.\n */\n filters?: Record<string, FilterConfig>;\n\n /**\n * The loggers to configure.\n */\n loggers?: LoggerConfig[];\n\n /**\n * Whether to reset the configuration before applying this one.\n */\n reset?: boolean;\n}\n\n/**\n * Sink configuration with module reference.\n * @since 2.0.0\n */\nexport interface SinkConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Formatter configuration or shorthand */\n formatter?: string | FormatterConfig;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Filter configuration with module reference.\n * @since 2.0.0\n */\nexport interface FilterConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Formatter configuration with module reference.\n * @since 2.0.0\n */\nexport interface FormatterConfig {\n /** Module reference in `module#export()` format */\n type: string;\n /** Additional options passed to the factory function */\n [key: string]: unknown;\n}\n\n/**\n * Logger configuration.\n * @since 2.0.0\n */\nexport interface LoggerConfig {\n /**\n * The category of the logger.\n */\n category: string | string[];\n\n /**\n * The sink identifiers to use.\n */\n sinks?: string[];\n\n /**\n * The filter identifiers to use.\n */\n filters?: string[];\n\n /**\n * The lowest log level to log.\n */\n lowestLevel?: LogLevel;\n\n /**\n * How to combine the logger's sinks with its ancestors' sinks. The\n * `\"forward\"` mode, available since 2.4.0, inherits ancestors' sinks\n * without applying their `lowestLevel` thresholds.\n */\n parentSinks?: \"inherit\" | \"override\" | \"forward\";\n}\n\n/**\n * Registry of shorthand mappings.\n * @since 2.0.0\n */\nexport interface ShorthandRegistry {\n /**\n * The shorthand mappings for sinks.\n */\n sinks?: Record<string, string>;\n\n /**\n * The shorthand mappings for filters.\n */\n filters?: Record<string, string>;\n\n /**\n * The shorthand mappings for formatters.\n */\n formatters?: Record<string, string>;\n}\n\n/**\n * Options for `configureFromObject()`.\n * @since 2.0.0\n */\nexport interface ConfigureOptions {\n /**\n * Custom shorthand mappings to extend or override defaults.\n */\n shorthands?: ShorthandRegistry;\n\n /**\n * The context-local storage to use for implicit contexts.\n *\n * In Node.js, Deno, and Bun, you can use `AsyncLocalStorage` from\n * the `node:async_hooks` module.\n *\n * @example\n * ```typescript\n * import { AsyncLocalStorage } from \"node:async_hooks\";\n * import { configureFromObject } from \"@logtape/config\";\n *\n * await configureFromObject(config, {\n * contextLocalStorage: new AsyncLocalStorage(),\n * });\n * ```\n */\n contextLocalStorage?: ContextLocalStorage<Record<string, unknown>>;\n\n /**\n * How to handle invalid configuration entries.\n *\n * - `\"throw\"` (default): Throw `ConfigError` on any invalid configuration.\n * - `\"warn\"`: Apply only valid parts and log warnings to meta logger.\n */\n onInvalidConfig?: \"throw\" | \"warn\";\n}\n\n/**\n * Options for environment variable expansion.\n * @since 2.0.0\n */\nexport interface EnvExpansionOptions {\n /**\n * Regular expression pattern for matching environment variables.\n * Default: `/\\$\\{([^}:]+)(?::([^}]+))?\\}/g` (matches `${VAR}` or `${VAR:default}`)\n */\n pattern?: RegExp;\n}\n\n/**\n * Parsed module reference.\n * @since 2.0.0\n */\nexport interface ParsedModuleReference {\n /** Whether this is a shorthand (starts with #) */\n isShorthand: boolean;\n /** The shorthand name (if isShorthand is true) */\n shorthandName?: string;\n /** The module path */\n modulePath?: string;\n /** The export name (after #) */\n exportName?: string;\n /** Whether this is a factory function (ends with ()) */\n isFactory: boolean;\n}\n\n/**\n * Error thrown when configuration is invalid.\n * @since 2.0.0\n */\nexport class ConfigError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ConfigError\";\n }\n}\n"],"mappings":";;;;;AA2LA,IAAa,cAAb,cAAiC,MAAM;CACrC,YAAYA,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;CACb;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logtape/config",
3
- "version": "2.4.0-dev.865+57354081",
3
+ "version": "2.4.0-dev.868+e1e92aaf",
4
4
  "description": "Configure LogTape from plain objects (JSON, YAML, TOML)",
5
5
  "keywords": [
6
6
  "logging",
@@ -49,7 +49,7 @@
49
49
  "dist/"
50
50
  ],
51
51
  "peerDependencies": {
52
- "@logtape/logtape": "^2.4.0-dev.865+57354081"
52
+ "@logtape/logtape": "^2.4.0-dev.868+e1e92aaf"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@alinea/suite": "^0.6.3",