@stacksjs/logging 0.74.51 → 0.74.53

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/runtime.d.ts CHANGED
@@ -7,5 +7,5 @@ export declare function report(error: unknown, options?: ReportOptions): void;
7
7
  * one implementation.
8
8
  */
9
9
  export declare const log: RuntimeLog;
10
- declare type RuntimeLog = Pick<Log, 'info' | 'warn' | 'error' | 'debug'>;
10
+ declare type RuntimeLog = Pick<Log, 'info' | 'warn' | 'error' | 'debug' | 'flush'>;
11
11
  declare type LoggingModule = typeof import('./index');
package/dist/runtime.js CHANGED
@@ -1 +1 @@
1
- import process from"node:process";const CONFIG_READY_KEY=Symbol.for("@stacksjs/config:overridesReady"),IMPLEMENTATION_LOADED_KEY=Symbol.for("@stacksjs/logging:implementation-loaded"),SUPPRESSED_LEVELS=new Set(["info","success","warn","warning","error"]);let implementationLoad;const resolvedVoid=Promise.resolve();let cachedConfigSignal,cachedConfigNeedsDebug;function loadImplementation(){return implementationLoad??=import("./index")}function implementationIsLoaded(){return globalThis[IMPLEMENTATION_LOADED_KEY]===!0}function configurationNeedsDebug(configuration,envLevel){const logging=configuration?.logging;if(Array.isArray(logging?.transports)&&logging.transports.length>0)return!0;if(envLevel)return envLevel==="debug";const level=logging?.level?.toLowerCase();return level==="debug"||level!==void 0&&!SUPPRESSED_LEVELS.has(level)}function delegateDebug(args){if(implementationIsLoaded())return loadImplementation().then((module)=>module.log.debug(...args));const envLevel=process.env.LOG_LEVEL?.toLowerCase();if(envLevel)return SUPPRESSED_LEVELS.has(envLevel)?resolvedVoid:loadImplementation().then((module)=>module.log.debug(...args));const ready=globalThis[CONFIG_READY_KEY];if(!ready||typeof ready.then!=="function")return resolvedVoid;const signal=ready;if(signal!==cachedConfigSignal){cachedConfigSignal=signal;cachedConfigNeedsDebug=void 0}else if(cachedConfigNeedsDebug!==void 0)return cachedConfigNeedsDebug?loadImplementation().then((module)=>module.log.debug(...args)):resolvedVoid;const current=Bun.peek(signal);if(current!==signal){cachedConfigNeedsDebug=configurationNeedsDebug(current,void 0);return cachedConfigNeedsDebug?loadImplementation().then((module)=>module.log.debug(...args)):resolvedVoid}return signal.then((configuration)=>{const needsDebug=configurationNeedsDebug(configuration,void 0);if(cachedConfigSignal===signal)cachedConfigNeedsDebug=needsDebug;if(needsDebug)return loadImplementation().then((module)=>module.log.debug(...args))})}export const log={info:(...args)=>loadImplementation().then((module)=>module.log.info(...args)),warn:(...args)=>loadImplementation().then((module)=>module.log.warn(...args)),error:(...args)=>loadImplementation().then((module)=>module.log.error(...args)),debug:(...args)=>delegateDebug(args)};export function report(error,options={}){loadImplementation().then((module)=>module.report(error,options))}
1
+ import process from"node:process";const CONFIG_READY_KEY=Symbol.for("@stacksjs/config:overridesReady"),IMPLEMENTATION_LOADED_KEY=Symbol.for("@stacksjs/logging:implementation-loaded"),SUPPRESSED_LEVELS=new Set(["info","success","warn","warning","error"]);let implementationLoad;const resolvedVoid=Promise.resolve();let cachedConfigSignal,cachedConfigNeedsDebug;function loadImplementation(){return implementationLoad??=import("./index")}function implementationIsLoaded(){return globalThis[IMPLEMENTATION_LOADED_KEY]===!0}function configurationNeedsDebug(configuration,envLevel){const logging=configuration?.logging;if(Array.isArray(logging?.transports)&&logging.transports.length>0)return!0;if(envLevel)return envLevel==="debug";const level=logging?.level?.toLowerCase();return level==="debug"||level!==void 0&&!SUPPRESSED_LEVELS.has(level)}function delegateDebug(args){if(implementationIsLoaded())return loadImplementation().then((module)=>module.log.debug(...args));const envLevel=process.env.LOG_LEVEL?.toLowerCase();if(envLevel)return SUPPRESSED_LEVELS.has(envLevel)?resolvedVoid:loadImplementation().then((module)=>module.log.debug(...args));const ready=globalThis[CONFIG_READY_KEY];if(!ready||typeof ready.then!=="function")return resolvedVoid;const signal=ready;if(signal!==cachedConfigSignal){cachedConfigSignal=signal;cachedConfigNeedsDebug=void 0}else if(cachedConfigNeedsDebug!==void 0)return cachedConfigNeedsDebug?loadImplementation().then((module)=>module.log.debug(...args)):resolvedVoid;const current=Bun.peek(signal);if(current!==signal){cachedConfigNeedsDebug=configurationNeedsDebug(current,void 0);return cachedConfigNeedsDebug?loadImplementation().then((module)=>module.log.debug(...args)):resolvedVoid}return signal.then((configuration)=>{const needsDebug=configurationNeedsDebug(configuration,void 0);if(cachedConfigSignal===signal)cachedConfigNeedsDebug=needsDebug;if(needsDebug)return loadImplementation().then((module)=>module.log.debug(...args))})}export const log={info:(...args)=>loadImplementation().then((module)=>module.log.info(...args)),warn:(...args)=>loadImplementation().then((module)=>module.log.warn(...args)),error:(...args)=>loadImplementation().then((module)=>module.log.error(...args)),debug:(...args)=>delegateDebug(args),flush:()=>loadImplementation().then((module)=>module.log.flush())};export function report(error,options={}){loadImplementation().then((module)=>module.report(error,options))}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/logging",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.74.51",
5
+ "version": "0.74.53",
6
6
  "description": "The Stacks logging system.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -66,15 +66,15 @@
66
66
  "dependencies": {
67
67
  "@loghq/stacks": "^0.2.3",
68
68
  "@stacksjs/clarity": "^0.3.33",
69
- "@stacksjs/config": "0.74.51",
70
- "@stacksjs/error-handling": "0.74.51",
71
- "@stacksjs/path": "0.74.51",
72
- "@stacksjs/types": "0.74.51"
69
+ "@stacksjs/config": "0.74.53",
70
+ "@stacksjs/error-handling": "0.74.53",
71
+ "@stacksjs/path": "0.74.53",
72
+ "@stacksjs/types": "0.74.53"
73
73
  },
74
74
  "devDependencies": {
75
- "@stacksjs/cli": "0.74.51",
76
- "@stacksjs/storage": "0.74.51",
77
- "@stacksjs/validation": "0.74.51",
75
+ "@stacksjs/cli": "0.74.53",
76
+ "@stacksjs/storage": "0.74.53",
77
+ "@stacksjs/validation": "0.74.53",
78
78
  "better-dx": "^0.2.24"
79
79
  }
80
80
  }