@visulima/pail 1.2.0 → 1.2.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE.md +11 -0
  3. package/README.md +1 -0
  4. package/dist/index.browser.cjs +1 -1
  5. package/dist/index.browser.d.cts +5 -5
  6. package/dist/index.browser.d.mts +5 -5
  7. package/dist/index.browser.d.ts +5 -5
  8. package/dist/index.browser.mjs +1 -1
  9. package/dist/index.server.cjs +4 -4
  10. package/dist/index.server.d.cts +7 -7
  11. package/dist/index.server.d.mts +7 -7
  12. package/dist/index.server.d.ts +7 -7
  13. package/dist/index.server.mjs +3 -3
  14. package/dist/processor.browser.d.cts +1 -1
  15. package/dist/processor.browser.d.mts +1 -1
  16. package/dist/processor.browser.d.ts +1 -1
  17. package/dist/processor.server.cjs +1 -1
  18. package/dist/processor.server.d.cts +3 -3
  19. package/dist/processor.server.d.mts +3 -3
  20. package/dist/processor.server.d.ts +3 -3
  21. package/dist/processor.server.mjs +1 -1
  22. package/dist/reporter.browser.cjs +2 -2
  23. package/dist/reporter.browser.d.cts +4 -4
  24. package/dist/reporter.browser.d.mts +4 -4
  25. package/dist/reporter.browser.d.ts +4 -4
  26. package/dist/reporter.browser.mjs +2 -2
  27. package/dist/reporter.server.cjs +9 -9
  28. package/dist/reporter.server.d.cts +7 -7
  29. package/dist/reporter.server.d.mts +7 -7
  30. package/dist/reporter.server.d.ts +7 -7
  31. package/dist/reporter.server.mjs +16 -8
  32. package/dist/shared/{pail.BU1VqUN1.cjs → pail.3G15muTS.cjs} +1 -1
  33. package/dist/shared/pail.B-Tp78gL.cjs +1 -0
  34. package/dist/shared/{pail.DwWkopDF.cjs → pail.B0AqLGpo.cjs} +1 -1
  35. package/dist/shared/{pail.Bdbc3_zr.d.ts → pail.BJCog1dH.d.cts} +3 -3
  36. package/dist/shared/{pail.DF5wQ_KA.mjs → pail.BP95fgQZ.mjs} +1 -1
  37. package/dist/shared/{pail.DW7tr027.d.cts → pail.BZABfski.d.ts} +3 -3
  38. package/dist/shared/{pail.D3wUM96H.mjs → pail.BlF6_AB7.mjs} +1 -1
  39. package/dist/shared/pail.Bz_4Ee-U.mjs +1 -0
  40. package/dist/shared/{pail.BP9NvmFd.mjs → pail.CKgnzwt6.mjs} +1 -1
  41. package/dist/shared/{pail.qb_TjNJQ.d.mts → pail.CLIvV09S.d.mts} +3 -3
  42. package/dist/shared/{pail.CHPrWCMI.d.ts → pail.Ce96Y7g-.d.cts} +3 -3
  43. package/dist/shared/pail.Cn4oOlxI.mjs +1 -0
  44. package/dist/shared/{pail.Cc48XFs7.d.mts → pail.D2WrlqMf.d.mts} +3 -3
  45. package/dist/shared/{pail.CzAicDBX.mjs → pail.D5MfZlaK.mjs} +1 -1
  46. package/dist/shared/pail.DFhaFnnA.cjs +1 -0
  47. package/dist/shared/{pail.DrhFTME0.d.cts → pail.DFxpsgpn.d.cts} +70 -17
  48. package/dist/shared/{pail.DrhFTME0.d.mts → pail.DFxpsgpn.d.mts} +70 -17
  49. package/dist/shared/{pail.DrhFTME0.d.ts → pail.DFxpsgpn.d.ts} +70 -17
  50. package/dist/shared/pail.DbDZ7fkY.mjs +1 -0
  51. package/dist/shared/pail.Di3NskY9.cjs +1 -0
  52. package/dist/shared/{pail.B4CNQvGO.d.cts → pail.Dn8rOK4m.d.ts} +3 -3
  53. package/dist/shared/{pail.BDMlOMw8.cjs → pail.NUhULbBB.cjs} +2 -2
  54. package/dist/shared/{pail.t5UYgSXE.cjs → pail.nUyAB-mN.cjs} +1 -1
  55. package/package.json +2 -1
  56. package/dist/shared/pail.Br_AAl-2.mjs +0 -1
  57. package/dist/shared/pail.BuhpbVGv.mjs +0 -1
  58. package/dist/shared/pail.D9OQPGNq.cjs +0 -1
  59. package/dist/shared/pail.DvAyNJOC.mjs +0 -1
  60. package/dist/shared/pail.boZRgdP1.cjs +0 -1
  61. package/dist/shared/pail.zBliJm8v.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## @visulima/pail [1.2.2](https://github.com/visulima/visulima/compare/@visulima/pail@1.2.1...@visulima/pail@1.2.2) (2024-06-14)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **pail:** fixed wrong global import of rotating-file-stream, this did call the require to early ([ac0c8bc](https://github.com/visulima/visulima/commit/ac0c8bcf3dfc5fb197e7b89ab5d32d3dc2ec5abd))
6
+
7
+ ## @visulima/pail [1.2.1](https://github.com/visulima/visulima/compare/@visulima/pail@1.2.0...@visulima/pail@1.2.1) (2024-06-13)
8
+
9
+ ### Bug Fixes
10
+
11
+ * **pail:** fixed wrong require use of rotating-file-stream ([37d9353](https://github.com/visulima/visulima/commit/37d9353e84f9373e1ba05c622e28a5a254d1d5e5))
12
+ * **pail:** moved import of rotating-file-stream into a lazy import, removed wrong never typing ([0513e27](https://github.com/visulima/visulima/commit/0513e2719eebda4d139ae406cfadd2ae483be5ba))
13
+
1
14
  ## @visulima/pail [1.2.0](https://github.com/visulima/visulima/compare/@visulima/pail@1.1.13...@visulima/pail@1.2.0) (2024-06-13)
2
15
 
3
16
  ### Features
package/LICENSE.md CHANGED
@@ -192,4 +192,15 @@ Repository: chalk/wrap-ansi
192
192
  <!-- DEPENDENCIES -->
193
193
 
194
194
  <!-- TYPE_DEPENDENCIES -->
195
+
196
+ # Licenses of bundled types
197
+ The published @visulima/pail artifact additionally contains code with the following licenses:
198
+ (MIT OR CC0-1.0)
199
+
200
+ # Bundled types:
201
+ ## type-fest
202
+ License: (MIT OR CC0-1.0)
203
+ By: Sindre Sorhus
204
+ Repository: sindresorhus/type-fest
205
+
195
206
  <!-- TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -107,6 +107,7 @@ Reporters are responsible for writing the log messages to the console or a file.
107
107
  | ---------------------------- | ------------------------- |
108
108
  | `JsonReporter` | `JsonReporter` |
109
109
  | `PrettyReporter` | `PrettyReporter` |
110
+ | x | `SimpleReporter` |
110
111
  | x | `FileReporter` |
111
112
 
112
113
  ### Processors
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared/pail.boZRgdP1.cjs"),i=require("./shared/pail.C0epjAht.cjs"),n=require("./shared/pail.B85Cx0UJ.cjs"),c=require("./shared/pail.zBliJm8v.cjs");var l=Object.defineProperty,u=o((e,r)=>l(e,"name",{value:r,configurable:!0}),"e");const s=u(e=>new a.PailBrowser({processors:[new n.g,...typeof window<"u"?[new i.L]:[]],reporters:[new c.i],...e}),"createPail"),w=s();exports.createPail=s;exports.pail=w;
1
+ "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared/pail.Di3NskY9.cjs"),i=require("./shared/pail.C0epjAht.cjs"),n=require("./shared/pail.B85Cx0UJ.cjs"),c=require("./shared/pail.B-Tp78gL.cjs");var l=Object.defineProperty,u=o((e,r)=>l(e,"name",{value:r,configurable:!0}),"e");const s=u(e=>new a.PailBrowser({processors:[new n.g,...typeof window<"u"?[new i.L]:[]],reporters:[new c.n],...e}),"createPail"),w=s();exports.createPail=s;exports.pail=w;
@@ -1,10 +1,10 @@
1
- import { P as PailBrowserType } from './shared/pail.DW7tr027.cjs';
2
- import { C as ConstructorOptions } from './shared/pail.DrhFTME0.cjs';
3
- export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DrhFTME0.cjs';
1
+ import { P as PailBrowserType } from './shared/pail.Ce96Y7g-.cjs';
2
+ import { C as ConstructorOptions } from './shared/pail.DFxpsgpn.cjs';
3
+ export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.cjs';
4
4
  import 'safe-stable-stringify';
5
5
  import '@visulima/colorize';
6
6
 
7
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
- declare const pail: PailBrowserType<never, never>;
7
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
+ declare const pail: PailBrowserType<string, string>;
9
9
 
10
10
  export { ConstructorOptions, PailBrowserType as Pail, createPail, pail };
@@ -1,10 +1,10 @@
1
- import { P as PailBrowserType } from './shared/pail.Cc48XFs7.mjs';
2
- import { C as ConstructorOptions } from './shared/pail.DrhFTME0.mjs';
3
- export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DrhFTME0.mjs';
1
+ import { P as PailBrowserType } from './shared/pail.D2WrlqMf.mjs';
2
+ import { C as ConstructorOptions } from './shared/pail.DFxpsgpn.mjs';
3
+ export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.mjs';
4
4
  import 'safe-stable-stringify';
5
5
  import '@visulima/colorize';
6
6
 
7
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
- declare const pail: PailBrowserType<never, never>;
7
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
+ declare const pail: PailBrowserType<string, string>;
9
9
 
10
10
  export { ConstructorOptions, PailBrowserType as Pail, createPail, pail };
@@ -1,10 +1,10 @@
1
- import { P as PailBrowserType } from './shared/pail.CHPrWCMI.js';
2
- import { C as ConstructorOptions } from './shared/pail.DrhFTME0.js';
3
- export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DrhFTME0.js';
1
+ import { P as PailBrowserType } from './shared/pail.BZABfski.js';
2
+ import { C as ConstructorOptions } from './shared/pail.DFxpsgpn.js';
3
+ export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.js';
4
4
  import 'safe-stable-stringify';
5
5
  import '@visulima/colorize';
6
6
 
7
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
- declare const pail: PailBrowserType<never, never>;
7
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
8
+ declare const pail: PailBrowserType<string, string>;
9
9
 
10
10
  export { ConstructorOptions, PailBrowserType as Pail, createPail, pail };
@@ -1 +1 @@
1
- var t=Object.defineProperty;var o=(r,e)=>t(r,"name",{value:e,configurable:!0});import{P as a}from"./shared/pail.DvAyNJOC.mjs";import{L as i}from"./shared/pail.CNxJnpWG.mjs";import{g as p}from"./shared/pail.nEbRCLhY.mjs";import{i as m}from"./shared/pail.BuhpbVGv.mjs";var n=Object.defineProperty,f=o((r,e)=>n(r,"name",{value:e,configurable:!0}),"e");const s=f(r=>new a({processors:[new p,...typeof window<"u"?[new i]:[]],reporters:[new m],...r}),"createPail"),v=s();export{s as createPail,v as pail};
1
+ var t=Object.defineProperty;var o=(r,e)=>t(r,"name",{value:e,configurable:!0});import{P as a}from"./shared/pail.DbDZ7fkY.mjs";import{L as i}from"./shared/pail.CNxJnpWG.mjs";import{g as n}from"./shared/pail.nEbRCLhY.mjs";import{n as p}from"./shared/pail.Bz_4Ee-U.mjs";var m=Object.defineProperty,f=o((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");const s=f(r=>new a({processors:[new n,...typeof window<"u"?[new i]:[]],reporters:[new p],...r}),"createPail"),v=s();export{s as createPail,v as pail};
@@ -1,5 +1,5 @@
1
- "use strict";var I=Object.defineProperty;var a=(r,t)=>I(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("node:process"),f=require("./shared/pail.BDMlOMw8.cjs"),E=require("node:string_decoder"),P=require("./shared/pail.boZRgdP1.cjs"),$=require("./shared/pail.C0epjAht.cjs"),j=require("./shared/pail.B85Cx0UJ.cjs");var O=Object.defineProperty,M=a((r,t)=>O(r,"name",{value:t,configurable:!0}),"l$1");let A=class{static{a(this,"v")}static{M(this,"InteractiveManager")}#t;#e=!1;#s=!1;#r=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#r}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#s}erase(t,e=this.#r){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#s&&(this.#s=!1,e&&this.erase(t,e),this.#r=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#s||(this.#s=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const o=this.#t[t],{columns:p,rows:i}=f.terminalSize(),u=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-u,d=Math.max(l-i,this.outside);let c=e.reduce((v,L)=>[...v,f.wrapAnsi(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(o.erase(i),u<d&&(c=c.slice(d-u+1))):l&&o.erase(l),o.write(c.join(`
1
+ "use strict";var I=Object.defineProperty;var a=(r,t)=>I(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("node:process"),g=require("./shared/pail.NUhULbBB.cjs"),E=require("node:string_decoder"),P=require("./shared/pail.Di3NskY9.cjs"),j=require("./shared/pail.C0epjAht.cjs"),$=require("./shared/pail.B85Cx0UJ.cjs");var O=Object.defineProperty,M=a((r,t)=>O(r,"name",{value:t,configurable:!0}),"l$1");let A=class{static{a(this,"v")}static{M(this,"InteractiveManager")}#t;#e=!1;#s=!1;#r=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#r}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#s}erase(t,e=this.#r){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#s&&(this.#s=!1,e&&this.erase(t,e),this.#r=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#s||(this.#s=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const o=this.#t[t],{columns:p,rows:i}=g.terminalSize(),u=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-u,d=Math.max(l-i,this.outside);let c=e.reduce((v,L)=>[...v,g.wrapAnsi(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(o.erase(i),u<d&&(c=c.slice(d-u+1))):l&&o.erase(l),o.write(c.join(`
2
2
  `)+`
3
- `),this.#r=d?d+c.length+1:c.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#r=0,this.#i=0}};var R=Object.defineProperty,y=a((r,t)=>R(r,"name",{value:t,configurable:!0}),"n$1");const h="\x1B[",g=h+"2J",x=h+"2K",N=h+"G",T=y((r=1)=>h+r+"A","cursorUp"),w=process.platform==="win32"?`${g}${h}0f`:`${g}${h}3J${h}H`,D=h+"?25l",q=h+"?25h",B=y(r=>{let t="";for(let e=0;e<r;e++)t+=x+(e<r-1?T():"");return r&&(t+=N),t},"eraseLines");var k=Object.defineProperty,G=a((r,t)=>k(r,"name",{value:t,configurable:!0}),"s$1");let m=class S{static{a(this,"t")}static{G(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new E.StringDecoder;#e=[];#s;#r;constructor(t){this.#s=t.write,this.#r=t}active(){this.write(D),this.#r.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),S.DRAIN}}erase(t){t>0&&this.write(B(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
- `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#r.write=this.#s,this.write(q)}write(t){this.#s.apply(this.#r,[t])}};var H=Object.defineProperty,V=a((r,t)=>H(r,"name",{value:t,configurable:!0}),"d");class C{static{a(this,"S")}static{V(this,"RawReporter")}#t;#e;#s;#r;#i=!1;constructor(){this.#e=n.stdout,this.#s=n.stderr}setStdout(t){this.#e=t}setStderr(t){this.#s=t}setStringify(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){const{context:e,groups:s,message:o,type:p}=t,i=[],u=typeof o=="string"?o:this.#t(o);i.push(u+""),e&&i.push(...e.map(v=>typeof v=="object"?" "+this.#t(v):" "+v));const l=["error","trace","warn"].includes(p.level)?"stderr":"stdout",d=l==="stderr"?this.#s:this.#e,c=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&d.isTTY?this.#r.update(l,(c+i.join("")).split(`
5
- `),0):f.n(c+i.join(""),d)}}var J=Object.defineProperty,U=a((r,t)=>J(r,"name",{value:t,configurable:!0}),"a");let z=class extends P.PailBrowserImpl{static{a(this,"f")}constructor(t={}){const{interactive:e,rawReporter:s,reporters:o,stderr:p,stdout:i,...u}=t;super(u),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new A(new m(this.stdout),new m(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(t.rawReporter??new C)}static{U(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(w),this.stderr.write(w)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}};const F=z;var K=Object.defineProperty,_=a((r,t)=>K(r,"name",{value:t,configurable:!0}),"t");const W=_(()=>n.env.NODE_ENV==="debug"||n.env.DEBUG!==void 0?"debug":n.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),b=_(r=>{let t=W();return n.env.PAIL_LOG_LEVEL!==void 0&&(t=n.env.PAIL_LOG_LEVEL),new F({logLevel:t,processors:[new j.g,new $.L],reporters:[new f.a],stderr:n.stderr,stdout:n.stdout,...r})},"createPail"),Y=b();exports.createPail=b;exports.pail=Y;
3
+ `),this.#r=d?d+c.length+1:c.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#r=0,this.#i=0}};var R=Object.defineProperty,S=a((r,t)=>R(r,"name",{value:t,configurable:!0}),"n$1");const h="\x1B[",f=h+"2J",x=h+"2K",N=h+"G",T=S((r=1)=>h+r+"A","cursorUp"),w=process.platform==="win32"?`${f}${h}0f`:`${f}${h}3J${h}H`,D=h+"?25l",q=h+"?25h",B=S(r=>{let t="";for(let e=0;e<r;e++)t+=x+(e<r-1?T():"");return r&&(t+=N),t},"eraseLines");var k=Object.defineProperty,G=a((r,t)=>k(r,"name",{value:t,configurable:!0}),"s$1");let m=class y{static{a(this,"t")}static{G(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new E.StringDecoder;#e=[];#s;#r;constructor(t){this.#s=t.write,this.#r=t}active(){this.write(D),this.#r.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),y.DRAIN}}erase(t){t>0&&this.write(B(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
+ `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#r.write=this.#s,this.write(q)}write(t){this.#s.apply(this.#r,[t])}};var H=Object.defineProperty,V=a((r,t)=>H(r,"name",{value:t,configurable:!0}),"d");let C=class{static{a(this,"S")}static{V(this,"RawReporter")}#t;#e;#s;#r;#i=!1;constructor(){this.#e=n.stdout,this.#s=n.stderr}setStdout(t){this.#e=t}setStderr(t){this.#s=t}setStringify(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){const{context:e,groups:s,message:o,type:p}=t,i=[],u=typeof o=="string"?o:this.#t(o);i.push(u+""),e&&i.push(...e.map(v=>typeof v=="object"?" "+this.#t(v):" "+v));const l=["error","trace","warn"].includes(p.level)?"stderr":"stdout",d=l==="stderr"?this.#s:this.#e,c=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&d.isTTY?this.#r.update(l,(c+i.join("")).split(`
5
+ `),0):g.n(c+i.join(""),d)}};var J=Object.defineProperty,U=a((r,t)=>J(r,"name",{value:t,configurable:!0}),"a");class z extends P.PailBrowserImpl{static{a(this,"v")}constructor(t={}){const{interactive:e,rawReporter:s,reporters:o,stderr:p,stdout:i,...u}=t;super(u),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new A(new m(this.stdout),new m(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(t.rawReporter??new C)}static{U(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(w),this.stderr.write(w)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const F=z;var K=Object.defineProperty,_=a((r,t)=>K(r,"name",{value:t,configurable:!0}),"t");const W=_(()=>n.env.NODE_ENV==="debug"||n.env.DEBUG!==void 0?"debug":n.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),b=_(r=>{let t=W();return n.env.PAIL_LOG_LEVEL!==void 0&&(t=n.env.PAIL_LOG_LEVEL),new F({logLevel:t,processors:[new $.g,new j.L],reporters:[new g.a],stderr:n.stderr,stdout:n.stdout,...r})},"createPail"),Y=b();exports.createPail=b;exports.pail=Y;
@@ -1,10 +1,10 @@
1
- import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DrhFTME0.cjs';
2
- export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DrhFTME0.cjs';
3
- import { a as PailBrowserImpl } from './shared/pail.DW7tr027.cjs';
1
+ import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DFxpsgpn.cjs';
2
+ export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.cjs';
3
+ import { a as PailBrowserImpl } from './shared/pail.Ce96Y7g-.cjs';
4
4
  import '@visulima/colorize';
5
5
  import 'safe-stable-stringify';
6
6
 
7
- declare class PailServerImpl<T extends string = never, L extends string = never> extends PailBrowserImpl<T, L> {
7
+ declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
8
8
  readonly options: ServerConstructorOptions<T, L>;
9
9
  protected readonly stdout: NodeJS.WriteStream;
10
10
  protected readonly stderr: NodeJS.WriteStream;
@@ -22,9 +22,9 @@ declare class PailServerImpl<T extends string = never, L extends string = never>
22
22
  private _wrapStream;
23
23
  private _restoreStream;
24
24
  }
25
- type PailServerType<T extends string = never, L extends string = never> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = never, LC extends string = never>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
25
+ type PailServerType<T extends string = string, L extends string = string> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
26
26
 
27
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
- declare const pail: PailServerType<never, never>;
27
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
+ declare const pail: PailServerType<string, string>;
29
29
 
30
30
  export { ConstructorOptions, DefaultLogTypes, LoggerFunction, type PailServerType as Pail, Reporter, createPail, pail };
@@ -1,10 +1,10 @@
1
- import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DrhFTME0.mjs';
2
- export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DrhFTME0.mjs';
3
- import { a as PailBrowserImpl } from './shared/pail.Cc48XFs7.mjs';
1
+ import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DFxpsgpn.mjs';
2
+ export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.mjs';
3
+ import { a as PailBrowserImpl } from './shared/pail.D2WrlqMf.mjs';
4
4
  import '@visulima/colorize';
5
5
  import 'safe-stable-stringify';
6
6
 
7
- declare class PailServerImpl<T extends string = never, L extends string = never> extends PailBrowserImpl<T, L> {
7
+ declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
8
8
  readonly options: ServerConstructorOptions<T, L>;
9
9
  protected readonly stdout: NodeJS.WriteStream;
10
10
  protected readonly stderr: NodeJS.WriteStream;
@@ -22,9 +22,9 @@ declare class PailServerImpl<T extends string = never, L extends string = never>
22
22
  private _wrapStream;
23
23
  private _restoreStream;
24
24
  }
25
- type PailServerType<T extends string = never, L extends string = never> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = never, LC extends string = never>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
25
+ type PailServerType<T extends string = string, L extends string = string> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
26
26
 
27
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
- declare const pail: PailServerType<never, never>;
27
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
+ declare const pail: PailServerType<string, string>;
29
29
 
30
30
  export { ConstructorOptions, DefaultLogTypes, LoggerFunction, type PailServerType as Pail, Reporter, createPail, pail };
@@ -1,10 +1,10 @@
1
- import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DrhFTME0.js';
2
- export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DrhFTME0.js';
3
- import { a as PailBrowserImpl } from './shared/pail.CHPrWCMI.js';
1
+ import { a as DefaultLogTypes, b as LoggerFunction, f as ServerConstructorOptions, I as InteractiveManager, R as Reporter, C as ConstructorOptions } from './shared/pail.DFxpsgpn.js';
2
+ export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './shared/pail.DFxpsgpn.js';
3
+ import { a as PailBrowserImpl } from './shared/pail.BZABfski.js';
4
4
  import '@visulima/colorize';
5
5
  import 'safe-stable-stringify';
6
6
 
7
- declare class PailServerImpl<T extends string = never, L extends string = never> extends PailBrowserImpl<T, L> {
7
+ declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
8
8
  readonly options: ServerConstructorOptions<T, L>;
9
9
  protected readonly stdout: NodeJS.WriteStream;
10
10
  protected readonly stderr: NodeJS.WriteStream;
@@ -22,9 +22,9 @@ declare class PailServerImpl<T extends string = never, L extends string = never>
22
22
  private _wrapStream;
23
23
  private _restoreStream;
24
24
  }
25
- type PailServerType<T extends string = never, L extends string = never> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = never, LC extends string = never>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
25
+ type PailServerType<T extends string = string, L extends string = string> = PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>);
26
26
 
27
- declare const createPail: <T extends string = never, L extends string = never>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
- declare const pail: PailServerType<never, never>;
27
+ declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
28
+ declare const pail: PailServerType<string, string>;
29
29
 
30
30
  export { ConstructorOptions, DefaultLogTypes, LoggerFunction, type PailServerType as Pail, Reporter, createPail, pail };
@@ -1,5 +1,5 @@
1
- var $=Object.defineProperty;var a=(r,t)=>$(r,"name",{value:t,configurable:!0});import{stdout as m,stderr as S,env as f}from"node:process";import{t as I,w as E,n as j,a as O}from"./shared/pail.CzAicDBX.mjs";import{StringDecoder as M}from"node:string_decoder";import{a as P}from"./shared/pail.DvAyNJOC.mjs";import{L as A}from"./shared/pail.CNxJnpWG.mjs";import{g as R}from"./shared/pail.nEbRCLhY.mjs";var x=Object.defineProperty,N=a((r,t)=>x(r,"name",{value:t,configurable:!0}),"l$1");let D=class{static{a(this,"v")}static{N(this,"InteractiveManager")}#t;#e=!1;#s=!1;#r=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#r}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#s}erase(t,e=this.#r){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#s&&(this.#s=!1,e&&this.erase(t,e),this.#r=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#s||(this.#s=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const o=this.#t[t],{columns:p,rows:i}=I(),c=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-c,u=Math.max(l-i,this.outside);let h=e.reduce((d,L)=>[...d,E(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(o.erase(i),c<u&&(h=h.slice(u-c+1))):l&&o.erase(l),o.write(h.join(`
1
+ var I=Object.defineProperty;var a=(r,t)=>I(r,"name",{value:t,configurable:!0});import{stdout as m,stderr as S,env as f}from"node:process";import{t as E,w as $,n as j,a as O}from"./shared/pail.D5MfZlaK.mjs";import{StringDecoder as M}from"node:string_decoder";import{a as P}from"./shared/pail.DbDZ7fkY.mjs";import{L as A}from"./shared/pail.CNxJnpWG.mjs";import{g as R}from"./shared/pail.nEbRCLhY.mjs";var x=Object.defineProperty,N=a((r,t)=>x(r,"name",{value:t,configurable:!0}),"l$1");let D=class{static{a(this,"v")}static{N(this,"InteractiveManager")}#t;#e=!1;#s=!1;#r=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#r}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#s}erase(t,e=this.#r){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#s&&(this.#s=!1,e&&this.erase(t,e),this.#r=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#s||(this.#s=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const o=this.#t[t],{columns:p,rows:i}=E(),c=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-c,u=Math.max(l-i,this.outside);let h=e.reduce((d,L)=>[...d,$(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(o.erase(i),c<u&&(h=h.slice(u-c+1))):l&&o.erase(l),o.write(h.join(`
2
2
  `)+`
3
3
  `),this.#r=u?u+h.length+1:h.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#r=0,this.#i=0}};var T=Object.defineProperty,y=a((r,t)=>T(r,"name",{value:t,configurable:!0}),"n$1");const n="\x1B[",v=n+"2J",B=n+"2K",k=n+"G",G=y((r=1)=>n+r+"A","cursorUp"),w=process.platform==="win32"?`${v}${n}0f`:`${v}${n}3J${n}H`,H=n+"?25l",V=n+"?25h",C=y(r=>{let t="";for(let e=0;e<r;e++)t+=B+(e<r-1?G():"");return r&&(t+=k),t},"eraseLines");var J=Object.defineProperty,U=a((r,t)=>J(r,"name",{value:t,configurable:!0}),"s$1");let g=class _{static{a(this,"t")}static{U(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new M;#e=[];#s;#r;constructor(t){this.#s=t.write,this.#r=t}active(){this.write(H),this.#r.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),_.DRAIN}}erase(t){t>0&&this.write(C(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
- `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#r.write=this.#s,this.write(V)}write(t){this.#s.apply(this.#r,[t])}};var z=Object.defineProperty,K=a((r,t)=>z(r,"name",{value:t,configurable:!0}),"d");class W{static{a(this,"S")}static{K(this,"RawReporter")}#t;#e;#s;#r;#i=!1;constructor(){this.#e=m,this.#s=S}setStdout(t){this.#e=t}setStderr(t){this.#s=t}setStringify(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){const{context:e,groups:s,message:o,type:p}=t,i=[],c=typeof o=="string"?o:this.#t(o);i.push(c+""),e&&i.push(...e.map(d=>typeof d=="object"?" "+this.#t(d):" "+d));const l=["error","trace","warn"].includes(p.level)?"stderr":"stdout",u=l==="stderr"?this.#s:this.#e,h=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&u.isTTY?this.#r.update(l,(h+i.join("")).split(`
5
- `),0):j(h+i.join(""),u)}}var Y=Object.defineProperty,q=a((r,t)=>Y(r,"name",{value:t,configurable:!0}),"a");let F=class extends P{static{a(this,"f")}constructor(t={}){const{interactive:e,rawReporter:s,reporters:o,stderr:p,stdout:i,...c}=t;super(c),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new D(new g(this.stdout),new g(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(t.rawReporter??new W)}static{q(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(w),this.stderr.write(w)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}};const Q=F;var X=Object.defineProperty,b=a((r,t)=>X(r,"name",{value:t,configurable:!0}),"t");const Z=b(()=>f.NODE_ENV==="debug"||f.DEBUG!==void 0?"debug":f.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),tt=b(r=>{let t=Z();return f.PAIL_LOG_LEVEL!==void 0&&(t=f.PAIL_LOG_LEVEL),new Q({logLevel:t,processors:[new R,new A],reporters:[new O],stderr:S,stdout:m,...r})},"createPail"),lt=tt();export{tt as createPail,lt as pail};
4
+ `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#r.write=this.#s,this.write(V)}write(t){this.#s.apply(this.#r,[t])}};var z=Object.defineProperty,K=a((r,t)=>z(r,"name",{value:t,configurable:!0}),"d");let W=class{static{a(this,"S")}static{K(this,"RawReporter")}#t;#e;#s;#r;#i=!1;constructor(){this.#e=m,this.#s=S}setStdout(t){this.#e=t}setStderr(t){this.#s=t}setStringify(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){const{context:e,groups:s,message:o,type:p}=t,i=[],c=typeof o=="string"?o:this.#t(o);i.push(c+""),e&&i.push(...e.map(d=>typeof d=="object"?" "+this.#t(d):" "+d));const l=["error","trace","warn"].includes(p.level)?"stderr":"stdout",u=l==="stderr"?this.#s:this.#e,h=s.map(()=>" ").join("");this.#i&&this.#r!==void 0&&u.isTTY?this.#r.update(l,(h+i.join("")).split(`
5
+ `),0):j(h+i.join(""),u)}};var Y=Object.defineProperty,q=a((r,t)=>Y(r,"name",{value:t,configurable:!0}),"a");class F extends P{static{a(this,"v")}constructor(t={}){const{interactive:e,rawReporter:s,reporters:o,stderr:p,stdout:i,...c}=t;super(c),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new D(new g(this.stdout),new g(this.stderr))),Array.isArray(o)&&this.registerReporters(o),this.rawReporter=this.extendReporter(t.rawReporter??new W)}static{q(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(w),this.stderr.write(w)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const Q=F;var X=Object.defineProperty,b=a((r,t)=>X(r,"name",{value:t,configurable:!0}),"t");const Z=b(()=>f.NODE_ENV==="debug"||f.DEBUG!==void 0?"debug":f.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),tt=b(r=>{let t=Z();return f.PAIL_LOG_LEVEL!==void 0&&(t=f.PAIL_LOG_LEVEL),new Q({logLevel:t,processors:[new R,new A],reporters:[new O],stderr:S,stdout:m,...r})},"createPail"),lt=tt();export{tt as createPail,lt as pail};
@@ -1,5 +1,5 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DrhFTME0.cjs';
2
+ import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.cjs';
3
3
  import '@visulima/colorize';
4
4
 
5
5
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -1,5 +1,5 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DrhFTME0.mjs';
2
+ import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.mjs';
3
3
  import '@visulima/colorize';
4
4
 
5
5
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -1,5 +1,5 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DrhFTME0.js';
2
+ import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.js';
3
3
  import '@visulima/colorize';
4
4
 
5
5
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -1 +1 @@
1
- "use strict";var i=Object.defineProperty;var t=(o,e)=>i(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared/pail.C0epjAht.cjs"),c=require("./shared/pail.B85Cx0UJ.cjs");var m=Object.defineProperty,u=t((o,e)=>m(o,"name",{value:e,configurable:!0}),"u");const N=u(()=>{const o=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const s=r.slice(1);return e=s,s},new Error().stack;const a=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return a?{columnNumber:a.columnNumber??void 0,fileName:a.fileName,lineNumber:a.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=o}},"getCallerFilename");var b=Object.defineProperty,f=t((o,e)=>b(o,"name",{value:e,configurable:!0}),"r");class g{static{t(this,"o")}static{f(this,"CallerProcessor")}process(e){const{columnNumber:a,fileName:l,lineNumber:r}=N();return e.file={column:a,line:r,name:l},e}}const p=g;exports.ErrorProcessor=n.L;exports.MessageFormatterProcessor=c.g;exports.CallerProcessor=p;
1
+ "use strict";var i=Object.defineProperty;var t=(o,e)=>i(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared/pail.C0epjAht.cjs"),c=require("./shared/pail.B85Cx0UJ.cjs");var m=Object.defineProperty,u=t((o,e)=>m(o,"name",{value:e,configurable:!0}),"u");const N=u(()=>{const o=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const s=r.slice(1);return e=s,s},new Error().stack;const a=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return a?{columnNumber:a.columnNumber??void 0,fileName:a.fileName,lineNumber:a.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=o}},"getCallerFilename");var b=Object.defineProperty,f=t((o,e)=>b(o,"name",{value:e,configurable:!0}),"r");class g{static{t(this,"a")}static{f(this,"CallerProcessor")}process(e){const{columnNumber:a,fileName:l,lineNumber:r}=N();return e.file={column:a,line:r,name:l},e}}const p=g;exports.ErrorProcessor=n.L;exports.MessageFormatterProcessor=c.g;exports.CallerProcessor=p;
@@ -1,4 +1,4 @@
1
- import { P as Processor, M as Meta } from './shared/pail.DrhFTME0.cjs';
1
+ import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.cjs';
2
2
  export { MessageFormatterProcessor } from './processor.browser.cjs';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
@@ -14,7 +14,7 @@ declare global {
14
14
  }
15
15
  }
16
16
  }
17
- declare class CallerProcessor<L extends string = never> implements Processor<L> {
17
+ declare class CallerProcessor<L extends string = string> implements Processor<L> {
18
18
  process(meta: Meta<L>): Meta<L>;
19
19
  }
20
20
 
@@ -35,7 +35,7 @@ declare global {
35
35
  }
36
36
  }
37
37
  }
38
- declare class ErrorProcessor<L extends string = never> implements Processor<L> {
38
+ declare class ErrorProcessor<L extends string = string> implements Processor<L> {
39
39
  private readonly _options;
40
40
  constructor(options?: {
41
41
  maxDepth?: number;
@@ -1,4 +1,4 @@
1
- import { P as Processor, M as Meta } from './shared/pail.DrhFTME0.mjs';
1
+ import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.mjs';
2
2
  export { MessageFormatterProcessor } from './processor.browser.mjs';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
@@ -14,7 +14,7 @@ declare global {
14
14
  }
15
15
  }
16
16
  }
17
- declare class CallerProcessor<L extends string = never> implements Processor<L> {
17
+ declare class CallerProcessor<L extends string = string> implements Processor<L> {
18
18
  process(meta: Meta<L>): Meta<L>;
19
19
  }
20
20
 
@@ -35,7 +35,7 @@ declare global {
35
35
  }
36
36
  }
37
37
  }
38
- declare class ErrorProcessor<L extends string = never> implements Processor<L> {
38
+ declare class ErrorProcessor<L extends string = string> implements Processor<L> {
39
39
  private readonly _options;
40
40
  constructor(options?: {
41
41
  maxDepth?: number;
@@ -1,4 +1,4 @@
1
- import { P as Processor, M as Meta } from './shared/pail.DrhFTME0.js';
1
+ import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.js';
2
2
  export { MessageFormatterProcessor } from './processor.browser.js';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
@@ -14,7 +14,7 @@ declare global {
14
14
  }
15
15
  }
16
16
  }
17
- declare class CallerProcessor<L extends string = never> implements Processor<L> {
17
+ declare class CallerProcessor<L extends string = string> implements Processor<L> {
18
18
  process(meta: Meta<L>): Meta<L>;
19
19
  }
20
20
 
@@ -35,7 +35,7 @@ declare global {
35
35
  }
36
36
  }
37
37
  }
38
- declare class ErrorProcessor<L extends string = never> implements Processor<L> {
38
+ declare class ErrorProcessor<L extends string = string> implements Processor<L> {
39
39
  private readonly _options;
40
40
  constructor(options?: {
41
41
  maxDepth?: number;
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(a,e)=>i(a,"name",{value:e,configurable:!0});import{L as d}from"./shared/pail.CNxJnpWG.mjs";import{g as y}from"./shared/pail.nEbRCLhY.mjs";var m=Object.defineProperty,s=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const c=s(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const t=r.slice(1);return e=t,t},new Error().stack;const o=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var u=Object.defineProperty,N=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{n(this,"o")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:l,lineNumber:r}=c();return e.file={column:o,line:r,name:l},e}}const f=b;export{f as CallerProcessor,d as ErrorProcessor,y as MessageFormatterProcessor};
1
+ var i=Object.defineProperty;var n=(a,e)=>i(a,"name",{value:e,configurable:!0});import{L as d}from"./shared/pail.CNxJnpWG.mjs";import{g as y}from"./shared/pail.nEbRCLhY.mjs";var m=Object.defineProperty,s=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const c=s(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const t=r.slice(1);return e=t,t},new Error().stack;const o=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var u=Object.defineProperty,N=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{n(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:l,lineNumber:r}=c();return e.file={column:o,line:r,name:l},e}}const f=b;export{f as CallerProcessor,d as ErrorProcessor,y as MessageFormatterProcessor};
@@ -1,5 +1,5 @@
1
- "use strict";var T=Object.defineProperty;var f=(n,l)=>T(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./shared/pail.zBliJm8v.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),v=require("./shared/pail.t5UYgSXE.cjs"),C=require("./shared/pail.DwWkopDF.cjs"),F=require("./shared/pail.BU1VqUN1.cjs"),M=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),D=M(o);var O=Object.defineProperty,k=f((n,l)=>O(n,"name",{value:l,configurable:!0}),"v");class B extends v.AbstractPrettyReporter{static{f(this,"F")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=F.a(l.type.level),{badge:w,context:x,date:u,error:A,groups:g,label:y,message:L,prefix:d,repeated:h,scope:p,suffix:m,type:R}=l,{color:P}=this._loggerTypes[R.name],j=P?D[P]:o.white,s=[];if(t&&g.length>0){const e=g.map(()=>" ").join(""),r=o.grey("["+g.at(-1)+"]");s.push(i.format(e+r[0],r.slice(1)))}if(u){const e=o.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(w){const e=j(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=v.o(this._loggerTypes);if(e.length>0){const r=o.grey(".".repeat(e.length));t?s.push(i.format(r[0]+" ",r.slice(1))):s.push([r[0]+" ",...r.slice(1)])}}const q=C.o(this._loggerTypes);let b;if(h){const e=o.white("["+h+"x]");b=t?i.format(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=j(this._formatLabel(y));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),b&&s.push(b);let r=q.length-y.length;if(h?r-=String(h).length+3:r+=1,r>0){const c=o.grey(".".repeat(r));t?s.push(i.format(c[0],c.slice(1))):s.push([" "+c[0],...c.slice(1)])}}else{const e=o.grey(".".repeat(q.length+1));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(p)&&p.length>0){const e=o.grey("["+p.join(" > ")+"]");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=o.grey((Array.isArray(p)&&p.length>0?". ":" ")+"["+(this._styles.underline.prefix?o.underline(d):d)+"] ");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(s.push(L),x&&s.push(...x),A&&s.push(A,`
1
+ "use strict";var T=Object.defineProperty;var f=(n,l)=>T(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./shared/pail.B-Tp78gL.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),L=require("./shared/pail.nUyAB-mN.cjs"),C=require("./shared/pail.B0AqLGpo.cjs"),F=require("./shared/pail.3G15muTS.cjs"),M=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),D=M(o);var O=Object.defineProperty,k=f((n,l)=>O(n,"name",{value:l,configurable:!0}),"A");class B extends L.AbstractPrettyReporter{static{f(this,"F")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=F.t(l.type.level),{badge:w,context:x,date:u,error:A,groups:g,label:y,message:P,prefix:d,repeated:h,scope:a,suffix:m,type:R}=l,{color:j}=this._loggerTypes[R.name],q=j?D[j]:o.white,s=[];if(t&&g.length>0){const e=g.map(()=>" ").join(""),r=o.grey("["+g.at(-1)+"]");s.push(i.format(e+r[0],r.slice(1)))}if(u){const e=o.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(w){const e=q(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=L.s(this._loggerTypes);if(e.length>0){const r=o.grey(".".repeat(e.length));t?s.push(i.format(r[0]+" ",r.slice(1))):s.push([r[0]+" ",...r.slice(1)])}}const v=C.s(this._loggerTypes);let b;if(h){const e=o.white("["+h+"x]");b=t?i.format(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=q(this._formatLabel(y));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),b&&s.push(b);let r=v.length-y.length;if(h?r-=String(h).length+3:r+=1,r>0){const c=o.grey(".".repeat(r));t?s.push(i.format(c[0],c.slice(1))):s.push([" "+c[0],...c.slice(1)])}}else{const e=o.grey(".".repeat(v.length+1));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(a)&&a.length>0){const e=o.grey("["+a.join(" > ")+"]");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=o.grey((Array.isArray(a)&&a.length>0?". ":" ")+"["+(this._styles.underline.prefix?o.underline(d):d)+"] ");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(s.push(P),x&&s.push(...x),A&&s.push(A,`
2
2
 
3
3
  `),m){const e=o.grey(this._styles.underline.suffix?o.underline(m):m);t?s.push(i.format(`
4
4
  `+e[0],e.slice(1))):s.push([`
5
- `+e[0],...e.slice(1)])}if(t)_(...s);else{let e="";const r=[],c=[];for(const a of s)Array.isArray(a)&&a.length>1&&a[0].includes("%c")?(e+=a[0],r.push(...a.slice(1))):c.push(a);_(e+"%c",...r,"",...c)}}_formatLabel(l){let t=this._styles.uppercase.label?l.toUpperCase():l;return t=this._styles.underline.label?o.underline(t):t,this._styles.bold.label&&(t=o.bold(t)),t}}const J=B;exports.JsonReporter=S.i;exports.PrettyReporter=J;
5
+ `+e[0],...e.slice(1)])}if(t)_(...s);else{let e="";const r=[],c=[];for(const p of s)Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=p[0],r.push(...p.slice(1))):c.push(p);_(e+"%c",...r,"",...c)}}_formatLabel(l){let t=this._styles.uppercase.label?l.toUpperCase():l;return t=this._styles.underline.label?o.underline(t):t,this._styles.bold.label&&(t=o.bold(t)),t}}const J=B;exports.JsonReporter=S.n;exports.PrettyReporter=J;
@@ -1,14 +1,14 @@
1
- import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DrhFTME0.cjs';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.B4CNQvGO.cjs';
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DFxpsgpn.cjs';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.BJCog1dH.cjs';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
- declare class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> {
6
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
7
  constructor();
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
11
- declare class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> {
11
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> {
12
12
  constructor(options?: Partial<PrettyStyleOptions>);
13
13
  log(meta: ReadonlyMeta<L>): void;
14
14
  private _formatLabel;
@@ -1,14 +1,14 @@
1
- import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DrhFTME0.mjs';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.qb_TjNJQ.mjs';
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DFxpsgpn.mjs';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.CLIvV09S.mjs';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
- declare class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> {
6
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
7
  constructor();
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
11
- declare class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> {
11
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> {
12
12
  constructor(options?: Partial<PrettyStyleOptions>);
13
13
  log(meta: ReadonlyMeta<L>): void;
14
14
  private _formatLabel;
@@ -1,14 +1,14 @@
1
- import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DrhFTME0.js';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.Bdbc3_zr.js';
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.DFxpsgpn.js';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.Dn8rOK4m.js';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
- declare class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> {
6
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
7
  constructor();
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
11
- declare class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> {
11
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> {
12
12
  constructor(options?: Partial<PrettyStyleOptions>);
13
13
  log(meta: ReadonlyMeta<L>): void;
14
14
  private _formatLabel;
@@ -1,5 +1,5 @@
1
- var $=Object.defineProperty;var b=(a,r)=>$(a,"name",{value:r,configurable:!0});import{i as V}from"./shared/pail.BuhpbVGv.mjs";import S,{white as j,grey as o,underline as _,bold as k}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{A as B,o as C}from"./shared/pail.D3wUM96H.mjs";import{o as D}from"./shared/pail.BP9NvmFd.mjs";import{a as J}from"./shared/pail.DF5wQ_KA.mjs";var M=Object.defineProperty,O=b((a,r)=>M(a,"name",{value:r,configurable:!0}),"v");class U extends B{static{b(this,"F")}static{O(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=J(r.type.level),{badge:A,context:w,date:h,error:v,groups:f,label:y,message:F,prefix:g,repeated:u,scope:n,suffix:m,type:L}=r,{color:P}=this._loggerTypes[L.name],R=P?S[P]:j,s=[];if(t&&f.length>0){const e=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");s.push(i(e+l[0],l.slice(1)))}if(h){const e=o(this._styles.dateFormatter(typeof h=="string"?new Date(h):h));t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(A){const e=R(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=C(this._loggerTypes);if(e.length>0){const l=o(".".repeat(e.length));t?s.push(i(l[0]+" ",l.slice(1))):s.push([l[0]+" ",...l.slice(1)])}}const T=D(this._loggerTypes);let d;if(u){const e=j("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=R(this._formatLabel(y));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),d&&s.push(d);let l=T.length-y.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?s.push(i(p[0],p.slice(1))):s.push([" "+p[0],...p.slice(1)])}}else{const e=o(".".repeat(T.length+1));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(n)&&n.length>0){const e=o("["+n.join(" > ")+"]");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(g){const e=o((Array.isArray(n)&&n.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(g):g)+"] ");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(s.push(F),w&&s.push(...w),v&&s.push(v,`
1
+ var L=Object.defineProperty;var b=(h,r)=>L(h,"name",{value:r,configurable:!0});import{n as V}from"./shared/pail.Bz_4Ee-U.mjs";import S,{white as $,grey as o,underline as _,bold as k}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{A as B,s as C}from"./shared/pail.BlF6_AB7.mjs";import{s as D}from"./shared/pail.CKgnzwt6.mjs";import{t as J}from"./shared/pail.BP95fgQZ.mjs";var M=Object.defineProperty,O=b((h,r)=>M(h,"name",{value:r,configurable:!0}),"A");class U extends B{static{b(this,"F")}static{O(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=J(r.type.level),{badge:A,context:w,date:a,error:v,groups:f,label:y,message:j,prefix:g,repeated:u,scope:c,suffix:m,type:F}=r,{color:R}=this._loggerTypes[F.name],P=R?S[R]:$,s=[];if(t&&f.length>0){const e=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");s.push(i(e+l[0],l.slice(1)))}if(a){const e=o(this._styles.dateFormatter(typeof a=="string"?new Date(a):a));t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(A){const e=P(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=C(this._loggerTypes);if(e.length>0){const l=o(".".repeat(e.length));t?s.push(i(l[0]+" ",l.slice(1))):s.push([l[0]+" ",...l.slice(1)])}}const T=D(this._loggerTypes);let d;if(u){const e=$("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=P(this._formatLabel(y));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),d&&s.push(d);let l=T.length-y.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?s.push(i(p[0],p.slice(1))):s.push([" "+p[0],...p.slice(1)])}}else{const e=o(".".repeat(T.length+1));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(c)&&c.length>0){const e=o("["+c.join(" > ")+"]");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(g){const e=o((Array.isArray(c)&&c.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(g):g)+"] ");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(s.push(j),w&&s.push(...w),v&&s.push(v,`
2
2
 
3
3
  `),m){const e=o(this._styles.underline.suffix?_(m):m);t?s.push(i(`
4
4
  `+e[0],e.slice(1))):s.push([`
5
- `+e[0],...e.slice(1)])}if(t)x(...s);else{let e="";const l=[],p=[];for(const c of s)Array.isArray(c)&&c.length>1&&c[0].includes("%c")?(e+=c[0],l.push(...c.slice(1))):p.push(c);x(e+"%c",...l,"",...p)}}_formatLabel(r){let t=this._styles.uppercase.label?r.toUpperCase():r;return t=this._styles.underline.label?_(t):t,this._styles.bold.label&&(t=k(t)),t}}const K=U;export{V as JsonReporter,K as PrettyReporter};
5
+ `+e[0],...e.slice(1)])}if(t)x(...s);else{let e="";const l=[],p=[];for(const n of s)Array.isArray(n)&&n.length>1&&n[0].includes("%c")?(e+=n[0],l.push(...n.slice(1))):p.push(n);x(e+"%c",...l,"",...p)}}_formatLabel(r){let t=this._styles.uppercase.label?r.toUpperCase():r;return t=this._styles.underline.label?_(t):t,this._styles.bold.label&&(t=k(t)),t}}const K=U;export{V as JsonReporter,K as PrettyReporter};
@@ -1,11 +1,11 @@
1
- "use strict";var L=Object.defineProperty;var n=(t,e)=>L(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("rotating-file-stream"),g=require("node:process"),l=require("./shared/pail.BDMlOMw8.cjs"),z=require("./shared/pail.D9OQPGNq.cjs"),a=require("@visulima/colorize"),A=require("./shared/pail.t5UYgSXE.cjs"),I=require("./shared/pail.DwWkopDF.cjs"),W=n(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),C=W(a);var D=Object.defineProperty,E=n((t,e)=>D(t,"name",{value:e,configurable:!0}),"i$2");let N=class{static{n(this,"s")}static{E(this,"SafeStreamHandler")}_ready=!0;_stream;_name;constructor(e,r){this._stream=e,this._name=r}write(e){this.writeStream(e)}end(...e){this._stream.end(...e)}writeStream(e){if(!this._ready){console.warn("Stream busy: "+this._name+'. Write will be dropped: "'+e+'"');return}this._ready=!1,this._stream.on("error",r=>{throw r}),this._stream.on("drain",()=>{this._ready=!0}),this._stream.on("finish",()=>{this._ready=!0}),this._ready=this._stream.write(e,()=>{})}};var G=Object.defineProperty,H=n((t,e)=>G(t,"name",{value:e,configurable:!0}),"r$2");class Y{static{n(this,"f")}static{H(this,"RotatingFileStream")}#e;#t;#r;#s;constructor(e,r=!1,s={}){this.#e=e,this.#t=r,this.#s=s,this.#t||(this.#r=q.createStream(this.#e,s))}write(e){let r=this.#r;this.#t&&(r=q.createStream(this.#e,this.#s));const s=new N(r,this.#e);s.write(e),this.#t&&s.end()}end(){this.#r!==void 0&&this.#r.end()}}var k=Object.defineProperty,B=n((t,e)=>k(t,"name",{value:e,configurable:!0}),"r$1");class F{static{n(this,"AbstractFileReporter")}static{B(this,"AbstractFileReporter")}stream;constructor(e){const{filePath:r,writeImmediately:s=!1,...o}=e;this.stream=new Y(r,s,o)}log(e){this.stream.write(this._formatMessage(e)+`
2
- `)}}var K=Object.defineProperty,Q=n((t,e)=>K(t,"name",{value:e,configurable:!0}),"s");let U=class extends F{static{n(this,"p")}static{Q(this,"JsonFileReporter")}#e;constructor(e){super({compress:"gzip",interval:"1d",size:"10M",...e})}setStringify(e){this.#e=e}_formatMessage(e){const{file:r,type:s,...o}=e;return o.label&&(o.label=o.label.trim()),r&&(o.file=r.name+":"+r.line+(r.column?":"+r.column:"")),this.#e(o)}};const V=U;var X=Object.defineProperty,Z=n((t,e)=>X(t,"name",{value:e,configurable:!0}),"r");class ee extends z.o{static{n(this,"p")}static{Z(this,"JsonReporter")}#e;#t;constructor(){super(),this.#e=g.stdout,this.#t=g.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const s=["error","warn"].includes(r)?this.#t:this.#e;l.n(e+`
3
- `,s)}}const te=ee;var re=Object.defineProperty,se=n((t,e)=>re(t,"name",{value:e,configurable:!0}),"R");class ie extends A.AbstractPrettyReporter{static{n(this,"q")}static{se(this,"SimpleReporter")}#e;#t;#r;#s=!1;constructor(e={}){super({uppercase:{label:!0,...e.uppercase},...e}),this.#e=g.stdout,this.#t=g.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#s=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=l.terminalSize();let s=r;typeof this._styles.messageLength=="number"&&(s=this._styles.messageLength);const{badge:o,context:w,date:u,error:S,file:d,groups:m,label:f,message:y,prefix:_,repeated:R,scope:b,suffix:v,traceError:j,type:M}=e,{color:P}=this._loggerTypes[M.name],x=P?C[P]:a.white,c=m.map(()=>" ").join(""),i=[];if(m.length>0&&i.push(c+a.grey("["+m.at(-1)+"]")+" "),u&&i.push(a.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),o)i.push(a.bold(x(o)));else{const h=A.o(this._loggerTypes);h.length>0&&i.push(a.grey(" ".repeat(h.length)))}const $=I.o(this._loggerTypes);f?i.push(a.bold(x(l.n$1(f,this._styles)))+" "," ".repeat($.length-l.stringLength(f))):i.push(" ".repeat($.length+1)),R&&i.push(a.bgGrey.white("["+R+"x]")+" "),Array.isArray(b)&&b.length>0&&i.push(a.grey("["+b.join(" > ")+"]")+" "),_&&i.push(a.grey("["+(this._styles.underline.prefix?a.underline(_):_)+"]")+" ");const O=l.stringLength(i.join("")),T=typeof y=="string"?y:this._stringify(y);if(i.push(c+l.wrapAnsi(T??"undefined",s-3,{hard:!0,trim:!0,wordWrap:!0})),w){let h=!1;i.push(...w.map(p=>{if(p instanceof Error)return h=!0,`
1
+ "use strict";var J=Object.defineProperty;var n=(e,t)=>J(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("node:process"),h=require("./shared/pail.NUhULbBB.cjs"),L=require("./shared/pail.DFhaFnnA.cjs"),o=require("@visulima/colorize"),q=require("./shared/pail.nUyAB-mN.cjs"),z=require("./shared/pail.B0AqLGpo.cjs"),I=n(e=>e&&typeof e=="object"&&"default"in e?e.default:e,"_interopDefaultCompat"),k=I(o);var E=Object.defineProperty,W=n((e,t)=>E(e,"name",{value:t,configurable:!0}),"e");let C=class{static{n(this,"n")}static{W(this,"SafeStreamHandler")}#t=!0;#e;#s;constructor(t,s){this.#e=t,this.#s=s}write(t){this.writeStream(t)}end(...t){this.#e.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn("Stream busy: "+this.#s+'. Write will be dropped: "'+t+'"');return}this.#t=!1,this.#e.on("error",s=>{throw s}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}};var D=Object.defineProperty,N=n((e,t)=>D(e,"name",{value:t,configurable:!0}),"r$2");class G{static{n(this,"o")}static{N(this,"RotatingFileStream")}#t;#e;#s;#r;#i;constructor(t,s=!1,r={}){if(this.#t=t,this.#e=s,this.#r=r,!this.#e){try{this.#i=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#s=this.#i(this.#t,r)}}write(t){let s=this.#s;this.#e&&(s=this.#i(this.#t,this.#r));const r=new C(s,this.#t);r.write(t),this.#e&&r.end()}end(){this.#s!==void 0&&this.#s.end()}}var H=Object.defineProperty,Y=n((e,t)=>H(e,"name",{value:t,configurable:!0}),"r$1");class M{static{n(this,"AbstractFileReporter")}static{Y(this,"AbstractFileReporter")}stream;constructor(t){const{filePath:s,writeImmediately:r=!1,...a}=t;this.stream=new G(s,r,a)}log(t){this.stream.write(this._formatMessage(t)+`
2
+ `)}}var B=Object.defineProperty,K=n((e,t)=>B(e,"name",{value:t,configurable:!0}),"s");class Q extends M{static{n(this,"p")}static{K(this,"JsonFileReporter")}#t;constructor(t){super({compress:"gzip",interval:"1d",size:"10M",...t})}setStringify(t){this.#t=t}_formatMessage(t){const{file:s,type:r,...a}=t;return a.label&&(a.label=a.label.trim()),s&&(a.file=s.name+":"+s.line+(s.column?":"+s.column:"")),this.#t(a)}}const U=Q;var V=Object.defineProperty,X=n((e,t)=>V(e,"name",{value:t,configurable:!0}),"r");class Z extends L.o{static{n(this,"a")}static{X(this,"JsonReporter")}#t;#e;constructor(){super(),this.#t=d.stdout,this.#e=d.stderr}setStdout(t){this.#t=t}setStderr(t){this.#e=t}_log(t,s){const r=["error","warn"].includes(s)?this.#e:this.#t;h.n(t+`
3
+ `,r)}}const tt=Z;var et=Object.defineProperty,st=n((e,t)=>et(e,"name",{value:t,configurable:!0}),"R");class rt extends q.AbstractPrettyReporter{static{n(this,"q")}static{st(this,"SimpleReporter")}#t;#e;#s;#r=!1;constructor(t={}){super({uppercase:{label:!0,...t.uppercase},...t}),this.#t=d.stdout,this.#e=d.stderr}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#s=t}setIsInteractive(t){this.#r=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:s}=h.terminalSize();let r=s;typeof this._styles.messageLength=="number"&&(r=this._styles.messageLength);const{badge:a,context:_,date:u,error:S,file:g,groups:f,label:m,message:y,prefix:b,repeated:R,scope:v,suffix:w,traceError:j,type:A}=t,{color:P}=this._loggerTypes[A.name],$=P?k[P]:o.white,c=f.map(()=>" ").join(""),i=[];if(f.length>0&&i.push(c+o.grey("["+f.at(-1)+"]")+" "),u&&i.push(o.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),a)i.push(o.bold($(a)));else{const l=q.s(this._loggerTypes);l.length>0&&i.push(o.grey(" ".repeat(l.length)))}const x=z.s(this._loggerTypes);m?i.push(o.bold($(h.n$1(m,this._styles)))+" "," ".repeat(x.length-h.stringLength(m))):i.push(" ".repeat(x.length+1)),R&&i.push(o.bgGrey.white("["+R+"x]")+" "),Array.isArray(v)&&v.length>0&&i.push(o.grey("["+v.join(" > ")+"]")+" "),b&&i.push(o.grey("["+(this._styles.underline.prefix?o.underline(b):b)+"]")+" ");const T=h.stringLength(i.join("")),F=typeof y=="string"?y:this._stringify(y);if(i.push(c+h.wrapAnsi(F??"undefined",r-3,{hard:!0,trim:!0,wordWrap:!0})),_){let l=!1;i.push(..._.map(p=>{if(p instanceof Error)return l=!0,`
4
4
 
5
- `+l.w(p,s,c);if(typeof p=="object")return" "+this._stringify(p);const J=(h?`
5
+ `+h.w(p,r,c);if(typeof p=="object")return" "+this._stringify(p);const O=(l?`
6
6
 
7
- `:" ")+p;return h=!1,J}))}if(S&&i.push(l.w(S,s,c)),j&&i.push(l.w(j,s,c,!0)),v&&i.push(" "+c+a.grey(this._styles.underline.suffix?a.underline(v):v)),d){const h=d.name+(d.line?":"+d.line:"");i.push(`
8
- `,a.grey("Caller: ")," ".repeat(O-8),h,`
9
- `)}return i.join("")}_log(e,r){const s=["error","trace","warn"].includes(r)?"stderr":"stdout",o=s==="stderr"?this.#t:this.#e;this.#s&&this.#r!==void 0&&o.isTTY?this.#r.update(s,e.split(`
10
- `),0):l.n(e+`
11
- `,o)}}const ne=ie;exports.PrettyReporter=l.a;exports.AbstractFileReporter=F;exports.JsonFileReporter=V;exports.JsonReporter=te;exports.SimpleReporter=ne;
7
+ `:" ")+p;return l=!1,O}))}if(S&&i.push(h.w(S,r,c)),j&&i.push(h.w(j,r,c,!0)),w&&i.push(" "+c+o.grey(this._styles.underline.suffix?o.underline(w):w)),g){const l=g.name+(g.line?":"+g.line:"");i.push(`
8
+ `,o.grey("Caller: ")," ".repeat(T-8),l,`
9
+ `)}return i.join("")}_log(t,s){const r=["error","trace","warn"].includes(s)?"stderr":"stdout",a=r==="stderr"?this.#e:this.#t;this.#r&&this.#s!==void 0&&a.isTTY?this.#s.update(r,t.split(`
10
+ `),0):h.n(t+`
11
+ `,a)}}const it=rt;exports.PrettyReporter=h.a;exports.AbstractFileReporter=M;exports.JsonFileReporter=U;exports.JsonReporter=tt;exports.SimpleReporter=it;