@visulima/pail 2.0.1 → 2.1.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## @visulima/pail [2.1.0](https://github.com/visulima/visulima/compare/@visulima/pail@2.0.1...@visulima/pail@2.1.0) (2024-07-10)
2
+
3
+ ### Features
4
+
5
+ * **pail:** added new options for the json error serializer ([6df9535](https://github.com/visulima/visulima/commit/6df95355cacc50f420d9fd6c583c13e69da728fb))
6
+
1
7
  ## @visulima/pail [2.0.1](https://github.com/visulima/visulima/compare/@visulima/pail@2.0.0...@visulima/pail@2.0.1) (2024-07-09)
2
8
 
3
9
  ### Bug Fixes
@@ -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 s=require("./shared/pail.CqyBdtm7.cjs"),i=require("./shared/pail.rUW_oLpx.cjs"),c=require("./shared/pail.B78_c-y4.cjs");var n=Object.defineProperty,l=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"e");const a=l(e=>new s.PailBrowser({processors:[new i.L],reporters:[new c.i],...e}),"createPail"),u=a();exports.createPail=a;exports.pail=u;
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 s=require("./shared/pail.CqyBdtm7.cjs"),i=require("./shared/pail.rUW_oLpx.cjs"),c=require("./shared/pail.BhNeTL0H.cjs");var n=Object.defineProperty,l=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"e");const a=l(e=>new s.PailBrowser({processors:[new i.L],reporters:[new c.i],...e}),"createPail"),u=a();exports.createPail=a;exports.pail=u;
@@ -1 +1 @@
1
- var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{P as t}from"./shared/pail.Bk25qk8U.mjs";import{L as i}from"./shared/pail.Bj_SDK4w.mjs";import{i as p}from"./shared/pail.DM_CW0V1.mjs";var m=Object.defineProperty,n=o((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");const s=n(r=>new t({processors:[new i],reporters:[new p],...r}),"createPail"),w=s();export{s as createPail,w as pail};
1
+ var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{P as t}from"./shared/pail.Bk25qk8U.mjs";import{L as i}from"./shared/pail.Bj_SDK4w.mjs";import{i as p}from"./shared/pail.DacemLQD.mjs";var m=Object.defineProperty,n=o((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");const s=n(r=>new t({processors:[new i],reporters:[new p],...r}),"createPail"),w=s();export{s as createPail,w as pail};
@@ -1,4 +1,4 @@
1
- "use strict";var S=Object.defineProperty;var f=(n,l)=>S(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./shared/pail.B78_c-y4.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),q=require("./shared/pail.BjvkVeLq.cjs"),v=require("./shared/pail.BtheZKQt.cjs"),Y=require("./shared/pail.3G15muTS.cjs"),C=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),O=C(o);var D=Object.defineProperty,k=f((n,l)=>D(n,"name",{value:l,configurable:!0}),"A");class B extends v.AbstractPrettyReporter{static{f(this,"Y")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=Y.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:T}=l,{color:L}=this._loggerTypes[T.name],R=L?O[L]: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=R(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=v.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 j=q.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=R(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=j.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(j.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(P!==q.EMPTY_SYMBOL&&s.push(P),x&&s.push(...x),A&&s.push(A,`
1
+ "use strict";var S=Object.defineProperty;var f=(n,l)=>S(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./shared/pail.BhNeTL0H.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),q=require("./shared/pail.BjvkVeLq.cjs"),v=require("./shared/pail.BtheZKQt.cjs"),Y=require("./shared/pail.3G15muTS.cjs"),C=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),O=C(o);var D=Object.defineProperty,k=f((n,l)=>D(n,"name",{value:l,configurable:!0}),"A");class B extends v.AbstractPrettyReporter{static{f(this,"Y")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=Y.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:T}=l,{color:L}=this._loggerTypes[T.name],R=L?O[L]: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=R(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=v.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 j=q.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=R(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=j.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(j.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(P!==q.EMPTY_SYMBOL&&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([`
@@ -1,10 +1,10 @@
1
1
  import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.cjs';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.Cmk6qgN4.cjs';
2
+ import { A as AbstractJsonReporter, a as AbstractJsonReporterOptions, b as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.5D809X_A.cjs';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
6
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
- constructor();
7
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
@@ -1,10 +1,10 @@
1
1
  import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.mjs';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.BD_y_CiZ.mjs';
2
+ import { A as AbstractJsonReporter, a as AbstractJsonReporterOptions, b as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.B3zJX3TP.mjs';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
6
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
- constructor();
7
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
@@ -1,10 +1,10 @@
1
1
  import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.js';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.AIbb1oDp.js';
2
+ import { A as AbstractJsonReporter, a as AbstractJsonReporterOptions, b as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.COeqT45B.js';
3
3
  import '@visulima/colorize';
4
4
  import 'safe-stable-stringify';
5
5
 
6
6
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
- constructor();
7
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
8
8
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
9
  }
10
10
 
@@ -1,4 +1,4 @@
1
- var j=Object.defineProperty;var b=(h,r)=>j(h,"name",{value:r,configurable:!0});import{i as V}from"./shared/pail.DM_CW0V1.mjs";import M,{white as Y,grey as o,underline as _,bold as S}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{s as E,E as O}from"./shared/pail.C1VNf0a-.mjs";import{A as k,s as B}from"./shared/pail.CeGWBihI.mjs";import{t as C}from"./shared/pail.BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,r)=>D(h,"name",{value:r,configurable:!0}),"A");class J extends k{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=C(r.type.level),{badge:A,context:w,date:a,error:P,groups:f,label:y,message:v,prefix:g,repeated:u,scope:n,suffix:m,type:$}=r,{color:R}=this._loggerTypes[$.name],T=R?M[R]:Y,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=T(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=B(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 L=E(this._loggerTypes);let d;if(u){const e=Y("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=T(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=L.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(L.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(v!==O&&s.push(v),w&&s.push(...w),P&&s.push(P,`
1
+ var j=Object.defineProperty;var b=(h,r)=>j(h,"name",{value:r,configurable:!0});import{i as V}from"./shared/pail.DacemLQD.mjs";import M,{white as Y,grey as o,underline as _,bold as S}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{s as E,E as O}from"./shared/pail.C1VNf0a-.mjs";import{A as k,s as B}from"./shared/pail.CeGWBihI.mjs";import{t as C}from"./shared/pail.BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,r)=>D(h,"name",{value:r,configurable:!0}),"A");class J extends k{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=C(r.type.level),{badge:A,context:w,date:a,error:P,groups:f,label:y,message:v,prefix:g,repeated:u,scope:n,suffix:m,type:$}=r,{color:R}=this._loggerTypes[$.name],T=R?M[R]:Y,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=T(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=B(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 L=E(this._loggerTypes);let d;if(u){const e=Y("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=T(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=L.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(L.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(v!==O&&s.push(v),w&&s.push(...w),P&&s.push(P,`
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([`
@@ -1,13 +1,13 @@
1
- "use strict";var I=Object.defineProperty;var o=(t,e)=>I(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./shared/pail.DHp7NF7R.cjs"),f=require("node:process"),l=require("./shared/pail.akgEzola.cjs"),r=require("@visulima/colorize"),S=require("@visulima/error"),L=require("@visulima/inspector"),k=require("./shared/pail.BjvkVeLq.cjs"),O=require("./shared/pail.BtheZKQt.cjs"),z=o(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),A=z(r);var B=Object.defineProperty,V=o((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");class W{static{o(this,"n")}static{V(this,"SafeStreamHandler")}#e=!0;#t;#r;constructor(e,s){this.#t=e,this.#r=s}write(e){this.writeStream(e)}end(...e){this.#t.end(...e)}get isReady(){return this.#e}writeStream(e){if(!this.#e){console.warn("Stream busy: "+this.#r+'. Write will be dropped: "'+e+'"');return}this.#e=!1,this.#t.on("error",s=>{throw s}),this.#t.on("drain",()=>{this.#e=!0}),this.#t.on("finish",()=>{this.#e=!0}),this.#e=this.#t.write(e,()=>{})}}var Y=Object.defineProperty,D=o((t,e)=>Y(t,"name",{value:e,configurable:!0}),"r$2");class G{static{o(this,"o")}static{D(this,"RotatingFileStream")}#e;#t;#r;#i;#s;constructor(e,s=!1,i={}){if(this.#e=e,this.#t=s,this.#i=i,!this.#t){try{this.#s=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.#r=this.#s(this.#e,i)}}write(e){let s=this.#r;this.#t&&(s=this.#s(this.#e,this.#i));const i=new W(s,this.#e);i.write(e),this.#t&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var H=Object.defineProperty,K=o((t,e)=>H(t,"name",{value:e,configurable:!0}),"r$1");class N extends T.p{static{o(this,"JsonFileReporter")}static{K(this,"JsonFileReporter")}stream;constructor(e){super();const{filePath:s,writeImmediately:i=!1,...a}=e;this.stream=new G(s,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(e){this.stream.write(e+`
2
- `)}}var Q=Object.defineProperty,U=o((t,e)=>Q(t,"name",{value:e,configurable:!0}),"r");class X extends T.p{static{o(this,"a")}static{U(this,"JsonReporter")}#e;#t;constructor(){super(),this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,s){const i=["error","warn"].includes(s)?this.#t:this.#e;l.n(e+`
3
- `,i)}}const Z=X;var ee=Object.defineProperty,F=o((t,e)=>ee(t,"name",{value:e,configurable:!0}),"L");const _=F(t=>!/[\\/]pail[\\/]dist/.test(t),"pailFileFilter");class te extends O.AbstractPrettyReporter{static{o(this,"SimpleReporter")}static{F(this,"SimpleReporter")}#e;#t;#r;#i=!1;#s;#n;constructor(e={}){const{error:s,inspect:i,...a}=e;super({uppercase:{label:!0,...a.uppercase},...a}),this.#s={...l.u,indent:void 0,...i},this.#n={...s,color:{fileLine:r.green,hint:r.cyan,marker:r.red,message:r.red,method:r.greenBright,title:r.red}},this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:s}=l.terminalSize();let i=s;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:a,context:R,date:u,error:j,file:d,groups:y,label:m,message:g,prefix:b,repeated:x,scope:v,suffix:w,traceError:E,type:C}=e,{color:P}=this._loggerTypes[C.name],M=P?A[P]:r.white,c=y.map(()=>" ").join(""),n=[];if(y.length>0&&n.push(c+r.grey("["+y.at(-1)+"]")+" "),u&&n.push(r.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),a)n.push(r.bold(M(a)));else{const h=O.s(this._loggerTypes);h.length>0&&n.push(r.grey(" ".repeat(h.length)))}const q=k.s(this._loggerTypes);m?n.push(r.bold(M(l.n$1(m,this._styles)))+" "," ".repeat(q.length-l.stringLength(m))):n.push(" ".repeat(q.length+1)),x&&n.push(r.bgGrey.white("["+x+"x]")+" "),Array.isArray(v)&&v.length>0&&n.push(r.grey("["+v.join(" > ")+"]")+" "),b&&n.push(r.grey("["+(this._styles.underline.prefix?r.underline(b):b)+"]")+" ");const J=l.stringLength(n.join(""));if(g!==k.EMPTY_SYMBOL){const h=typeof g=="string"?g:L.inspect(g,this.#s);n.push(c+l.wrapAnsi(h,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(R){let h=!1;n.push(...R.map(p=>{if(p instanceof Error)return h=!0,`
1
+ "use strict";var $=Object.defineProperty;var n=(t,e)=>$(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./shared/pail.DumOHFo9.cjs"),f=require("node:process"),c=require("./shared/pail.akgEzola.cjs"),r=require("@visulima/colorize"),S=require("@visulima/error"),L=require("@visulima/inspector"),k=require("./shared/pail.BjvkVeLq.cjs"),J=require("./shared/pail.BtheZKQt.cjs"),I=n(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),z=I(r);var B=Object.defineProperty,V=n((t,e)=>B(t,"name",{value:e,configurable:!0}),"e$1");class W{static{n(this,"n")}static{V(this,"SafeStreamHandler")}#e=!0;#t;#r;constructor(e,s){this.#t=e,this.#r=s}write(e){this.writeStream(e)}end(...e){this.#t.end(...e)}get isReady(){return this.#e}writeStream(e){if(!this.#e){console.warn("Stream busy: "+this.#r+'. Write will be dropped: "'+e+'"');return}this.#e=!1,this.#t.on("error",s=>{throw s}),this.#t.on("drain",()=>{this.#e=!0}),this.#t.on("finish",()=>{this.#e=!0}),this.#e=this.#t.write(e,()=>{})}}var Y=Object.defineProperty,D=n((t,e)=>Y(t,"name",{value:e,configurable:!0}),"r$1");class G{static{n(this,"o")}static{D(this,"RotatingFileStream")}#e;#t;#r;#i;#s;constructor(e,s=!1,i={}){if(this.#e=e,this.#t=s,this.#i=i,!this.#t){try{this.#s=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.#r=this.#s(this.#e,i)}}write(e){let s=this.#r;this.#t&&(s=this.#s(this.#e,this.#i));const i=new W(s,this.#e);i.write(e),this.#t&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var H=Object.defineProperty,K=n((t,e)=>H(t,"name",{value:e,configurable:!0}),"r");class N extends O.AbstractJsonReporter{static{n(this,"JsonFileReporter")}static{K(this,"JsonFileReporter")}stream;constructor(e){super();const{filePath:s,writeImmediately:i=!1,...a}=e;this.stream=new G(s,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(e){this.stream.write(e+`
2
+ `)}}var Q=Object.defineProperty,U=n((t,e)=>Q(t,"name",{value:e,configurable:!0}),"e");class X extends O.AbstractJsonReporter{static{n(this,"d")}static{U(this,"JsonReporter")}#e;#t;constructor(e={}){super(e),this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,s){const i=["error","warn"].includes(s)?this.#t:this.#e;c.n(e+`
3
+ `,i)}}const Z=X;var ee=Object.defineProperty,T=n((t,e)=>ee(t,"name",{value:e,configurable:!0}),"L");const _=T(t=>!/[\\/]pail[\\/]dist/.test(t),"pailFileFilter");class te extends J.AbstractPrettyReporter{static{n(this,"SimpleReporter")}static{T(this,"SimpleReporter")}#e;#t;#r;#i=!1;#s;#o;constructor(e={}){const{error:s,inspect:i,...a}=e;super({uppercase:{label:!0,...a.uppercase},...a}),this.#s={...c.u,indent:void 0,...i},this.#o={...s,color:{fileLine:r.green,hint:r.cyan,marker:r.red,message:r.red,method:r.greenBright,title:r.red}},this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:s}=c.terminalSize();let i=s;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:a,context:R,date:u,error:j,file:d,groups:y,label:m,message:g,prefix:b,repeated:x,scope:v,suffix:w,traceError:E,type:F}=e,{color:P}=this._loggerTypes[F.name],M=P?z[P]:r.white,l=y.map(()=>" ").join(""),o=[];if(y.length>0&&o.push(l+r.grey("["+y.at(-1)+"]")+" "),u&&o.push(r.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),a)o.push(r.bold(M(a)));else{const h=J.s(this._loggerTypes);h.length>0&&o.push(r.grey(" ".repeat(h.length)))}const q=k.s(this._loggerTypes);m?o.push(r.bold(M(c.n$1(m,this._styles)))+" "," ".repeat(q.length-c.stringLength(m))):o.push(" ".repeat(q.length+1)),x&&o.push(r.bgGrey.white("["+x+"x]")+" "),Array.isArray(v)&&v.length>0&&o.push(r.grey("["+v.join(" > ")+"]")+" "),b&&o.push(r.grey("["+(this._styles.underline.prefix?r.underline(b):b)+"]")+" ");const A=c.stringLength(o.join(""));if(g!==k.EMPTY_SYMBOL){const h=typeof g=="string"?g:L.inspect(g,this.#s);o.push(l+c.wrapAnsi(h,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(R){let h=!1;o.push(...R.map(p=>{if(p instanceof Error)return h=!0,`
4
4
 
5
- `+S.renderError(p,{...this.#n,filterStacktrace:_,prefix:c});if(typeof p=="object")return" "+L.inspect(p,this.#s);const $=(h?`
5
+ `+S.renderError(p,{...this.#o,filterStacktrace:_,prefix:l});if(typeof p=="object")return" "+L.inspect(p,this.#s);const C=(h?`
6
6
 
7
- `:" ")+p;return h=!1,$}))}if(j&&n.push(S.renderError(j,{...this.#n,filterStacktrace:_,prefix:c})),E&&n.push(`
7
+ `:" ")+p;return h=!1,C}))}if(j&&o.push(S.renderError(j,{...this.#o,filterStacktrace:_,prefix:l})),E&&o.push(`
8
8
 
9
- `+S.renderError(E,{...this.#n,filterStacktrace:_,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:c})),w&&n.push(" "+c+r.grey(this._styles.underline.suffix?r.underline(w):w)),d){const h=d.name+(d.line?":"+d.line:"");n.push(`
10
- `,r.grey("Caller: ")," ".repeat(J-8),h,`
11
- `)}return n.join("")}_log(e,s){const i=["error","trace","warn"].includes(s)?"stderr":"stdout",a=i==="stderr"?this.#t:this.#e;this.#i&&this.#r!==void 0&&a.isTTY?this.#r.update(i,e.split(`
12
- `),0):l.n(e+`
13
- `,a)}}exports.PrettyReporter=l.PrettyReporter;exports.JsonFileReporter=N;exports.JsonReporter=Z;exports.SimpleReporter=te;
9
+ `+S.renderError(E,{...this.#o,filterStacktrace:_,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})),w&&o.push(" "+l+r.grey(this._styles.underline.suffix?r.underline(w):w)),d){const h=d.name+(d.line?":"+d.line:"");o.push(`
10
+ `,r.grey("Caller: ")," ".repeat(A-8),h,`
11
+ `)}return o.join("")}_log(e,s){const i=["error","trace","warn"].includes(s)?"stderr":"stdout",a=i==="stderr"?this.#t:this.#e;this.#i&&this.#r!==void 0&&a.isTTY?this.#r.update(i,e.split(`
12
+ `),0):c.n(e+`
13
+ `,a)}}exports.PrettyReporter=c.PrettyReporter;exports.JsonFileReporter=N;exports.JsonReporter=Z;exports.SimpleReporter=te;
@@ -1,5 +1,5 @@
1
1
  import { Options } from 'rotating-file-stream';
2
- import { A as AbstractJsonReporter, P as PrettyStyleOptions, a as AbstractPrettyReporter } from './shared/pail.Cmk6qgN4.cjs';
2
+ import { a as AbstractJsonReporterOptions, A as AbstractJsonReporter, P as PrettyStyleOptions, b as AbstractPrettyReporter } from './shared/pail.5D809X_A.cjs';
3
3
  import { S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.cjs';
4
4
  import { RenderErrorOptions } from '@visulima/error/error';
5
5
  import { Options as Options$1 } from '@visulima/inspector';
@@ -14,7 +14,7 @@ declare class RotatingFileStream {
14
14
  end(): void;
15
15
  }
16
16
 
17
- type FileReporterOptions = Options & {
17
+ type FileReporterOptions = AbstractJsonReporterOptions & Options & {
18
18
  filePath: string;
19
19
  writeImmediately?: boolean;
20
20
  };
@@ -26,7 +26,7 @@ declare class JsonFileReporter<L extends string = string> extends AbstractJsonRe
26
26
 
27
27
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
28
28
  #private;
29
- constructor();
29
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
30
30
  setStdout(stdout_: NodeJS.WriteStream): void;
31
31
  setStderr(stderr_: NodeJS.WriteStream): void;
32
32
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -1,5 +1,5 @@
1
1
  import { Options } from 'rotating-file-stream';
2
- import { A as AbstractJsonReporter, P as PrettyStyleOptions, a as AbstractPrettyReporter } from './shared/pail.BD_y_CiZ.mjs';
2
+ import { a as AbstractJsonReporterOptions, A as AbstractJsonReporter, P as PrettyStyleOptions, b as AbstractPrettyReporter } from './shared/pail.B3zJX3TP.mjs';
3
3
  import { S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.mjs';
4
4
  import { RenderErrorOptions } from '@visulima/error/error';
5
5
  import { Options as Options$1 } from '@visulima/inspector';
@@ -14,7 +14,7 @@ declare class RotatingFileStream {
14
14
  end(): void;
15
15
  }
16
16
 
17
- type FileReporterOptions = Options & {
17
+ type FileReporterOptions = AbstractJsonReporterOptions & Options & {
18
18
  filePath: string;
19
19
  writeImmediately?: boolean;
20
20
  };
@@ -26,7 +26,7 @@ declare class JsonFileReporter<L extends string = string> extends AbstractJsonRe
26
26
 
27
27
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
28
28
  #private;
29
- constructor();
29
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
30
30
  setStdout(stdout_: NodeJS.WriteStream): void;
31
31
  setStderr(stderr_: NodeJS.WriteStream): void;
32
32
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -1,5 +1,5 @@
1
1
  import { Options } from 'rotating-file-stream';
2
- import { A as AbstractJsonReporter, P as PrettyStyleOptions, a as AbstractPrettyReporter } from './shared/pail.AIbb1oDp.js';
2
+ import { a as AbstractJsonReporterOptions, A as AbstractJsonReporter, P as PrettyStyleOptions, b as AbstractPrettyReporter } from './shared/pail.COeqT45B.js';
3
3
  import { S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.js';
4
4
  import { RenderErrorOptions } from '@visulima/error/error';
5
5
  import { Options as Options$1 } from '@visulima/inspector';
@@ -14,7 +14,7 @@ declare class RotatingFileStream {
14
14
  end(): void;
15
15
  }
16
16
 
17
- type FileReporterOptions = Options & {
17
+ type FileReporterOptions = AbstractJsonReporterOptions & Options & {
18
18
  filePath: string;
19
19
  writeImmediately?: boolean;
20
20
  };
@@ -26,7 +26,7 @@ declare class JsonFileReporter<L extends string = string> extends AbstractJsonRe
26
26
 
27
27
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
28
28
  #private;
29
- constructor();
29
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
30
30
  setStdout(stdout_: NodeJS.WriteStream): void;
31
31
  setStderr(stderr_: NodeJS.WriteStream): void;
32
32
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -1,4 +1,4 @@
1
- var V=Object.defineProperty;var a=(e,t)=>V(e,"name",{value:t,configurable:!0});import{p as F}from"./shared/pail.Bbo15e5K.mjs";import{stdout as L,stderr as A}from"node:process";import{n as C,u as W,t as Y,a as q,s as M,w as D}from"./shared/pail.C2dcjpQV.mjs";import{P as $t}from"./shared/pail.C2dcjpQV.mjs";import G,{green as H,cyan as K,red as v,greenBright as N,white as Q,grey as h,bold as k,bgGrey as U,underline as O}from"@visulima/colorize";import{renderError as b}from"@visulima/error";import{inspect as T}from"@visulima/inspector";import{s as X,E as Z}from"./shared/pail.C1VNf0a-.mjs";import{A as tt,s as et}from"./shared/pail.CeGWBihI.mjs";
1
+ var V=Object.defineProperty;var a=(e,t)=>V(e,"name",{value:t,configurable:!0});import{A as T}from"./shared/pail.DzwLG-N9.mjs";import{stdout as F,stderr as L}from"node:process";import{n as C,u as W,t as Y,a as q,s as $,w as D}from"./shared/pail.C2dcjpQV.mjs";import{P as Mt}from"./shared/pail.C2dcjpQV.mjs";import G,{green as H,cyan as K,red as v,greenBright as N,white as Q,grey as h,bold as k,bgGrey as U,underline as A}from"@visulima/colorize";import{renderError as b}from"@visulima/error";import{inspect as O}from"@visulima/inspector";import{s as X,E as Z}from"./shared/pail.C1VNf0a-.mjs";import{A as tt,s as et}from"./shared/pail.CeGWBihI.mjs";
2
2
  // -- pack CommonJS Shims --
3
3
  import __cjs_url__ from "node:url";
4
4
  import __cjs_path__ from "node:path";
@@ -6,16 +6,16 @@ import __cjs_mod__ from "node:module";
6
6
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
7
7
  const __dirname = __cjs_path__.dirname(__filename);
8
8
  const require = __cjs_mod__.createRequire(import.meta.url);
9
- var rt=Object.defineProperty,st=a((e,t)=>rt(e,"name",{value:t,configurable:!0}),"e");class it{static{a(this,"n")}static{st(this,"SafeStreamHandler")}#t=!0;#e;#r;constructor(t,r){this.#e=t,this.#r=r}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.#r+'. Write will be dropped: "'+t+'"');return}this.#t=!1,this.#e.on("error",r=>{throw r}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var at=Object.defineProperty,ot=a((e,t)=>at(e,"name",{value:t,configurable:!0}),"r$2");class nt{static{a(this,"o")}static{ot(this,"RotatingFileStream")}#t;#e;#r;#i;#s;constructor(t,r=!1,s={}){if(this.#t=t,this.#e=r,this.#i=s,!this.#e){try{this.#s=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.#r=this.#s(this.#t,s)}}write(t){let r=this.#r;this.#e&&(r=this.#s(this.#t,this.#i));const s=new it(r,this.#t);s.write(t),this.#e&&s.end()}end(){this.#r!==void 0&&this.#r.end()}}var ht=Object.defineProperty,lt=a((e,t)=>ht(e,"name",{value:t,configurable:!0}),"r$1");class xt extends F{static{a(this,"JsonFileReporter")}static{lt(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:r,writeImmediately:s=!1,...o}=t;this.stream=new nt(r,s,{compress:"gzip",interval:"1d",size:"10M",...o})}_log(t){this.stream.write(t+`
10
- `)}}var pt=Object.defineProperty,ct=a((e,t)=>pt(e,"name",{value:t,configurable:!0}),"r");class ut extends F{static{a(this,"a")}static{ct(this,"JsonReporter")}#t;#e;constructor(){super(),this.#t=L,this.#e=A}setStdout(t){this.#t=t}setStderr(t){this.#e=t}_log(t,r){const s=["error","warn"].includes(r)?this.#e:this.#t;C(t+`
11
- `,s)}}const jt=ut;var dt=Object.defineProperty,I=a((e,t)=>dt(e,"name",{value:t,configurable:!0}),"L");const S=I(e=>!/[\\/]pail[\\/]dist/.test(e),"pailFileFilter");class Et extends tt{static{a(this,"SimpleReporter")}static{I(this,"SimpleReporter")}#t;#e;#r;#i=!1;#s;#a;constructor(t={}){const{error:r,inspect:s,...o}=t;super({uppercase:{label:!0,...o.uppercase},...o}),this.#s={...W,indent:void 0,...s},this.#a={...r,color:{fileLine:H,hint:K,marker:v,message:v,method:N,title:v}},this.#t=L,this.#e=A}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=Y();let s=r;typeof this._styles.messageLength=="number"&&(s=this._styles.messageLength);const{badge:o,context:_,date:c,error:x,file:u,groups:m,label:f,message:d,prefix:g,repeated:j,scope:y,suffix:w,traceError:E,type:z}=t,{color:R}=this._loggerTypes[z.name],P=R?G[R]:Q,l=m.map(()=>" ").join(""),i=[];if(m.length>0&&i.push(l+h("["+m.at(-1)+"]")+" "),c&&i.push(h(this._styles.dateFormatter(typeof c=="string"?new Date(c):c))+" "),o)i.push(k(P(o)));else{const n=et(this._loggerTypes);n.length>0&&i.push(h(" ".repeat(n.length)))}const $=X(this._loggerTypes);f?i.push(k(P(q(f,this._styles)))+" "," ".repeat($.length-M(f))):i.push(" ".repeat($.length+1)),j&&i.push(U.white("["+j+"x]")+" "),Array.isArray(y)&&y.length>0&&i.push(h("["+y.join(" > ")+"]")+" "),g&&i.push(h("["+(this._styles.underline.prefix?O(g):g)+"]")+" ");const J=M(i.join(""));if(d!==Z){const n=typeof d=="string"?d:T(d,this.#s);i.push(l+D(n,s-3,{hard:!0,trim:!1,wordWrap:!0}))}if(_){let n=!1;i.push(..._.map(p=>{if(p instanceof Error)return n=!0,`
9
+ var rt=Object.defineProperty,st=a((e,t)=>rt(e,"name",{value:t,configurable:!0}),"e$1");class it{static{a(this,"n")}static{st(this,"SafeStreamHandler")}#t=!0;#e;#r;constructor(t,r){this.#e=t,this.#r=r}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.#r+'. Write will be dropped: "'+t+'"');return}this.#t=!1,this.#e.on("error",r=>{throw r}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var at=Object.defineProperty,ot=a((e,t)=>at(e,"name",{value:t,configurable:!0}),"r$1");class nt{static{a(this,"o")}static{ot(this,"RotatingFileStream")}#t;#e;#r;#i;#s;constructor(t,r=!1,s={}){if(this.#t=t,this.#e=r,this.#i=s,!this.#e){try{this.#s=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.#r=this.#s(this.#t,s)}}write(t){let r=this.#r;this.#e&&(r=this.#s(this.#t,this.#i));const s=new it(r,this.#t);s.write(t),this.#e&&s.end()}end(){this.#r!==void 0&&this.#r.end()}}var ht=Object.defineProperty,lt=a((e,t)=>ht(e,"name",{value:t,configurable:!0}),"r");class xt extends T{static{a(this,"JsonFileReporter")}static{lt(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:r,writeImmediately:s=!1,...o}=t;this.stream=new nt(r,s,{compress:"gzip",interval:"1d",size:"10M",...o})}_log(t){this.stream.write(t+`
10
+ `)}}var pt=Object.defineProperty,ct=a((e,t)=>pt(e,"name",{value:t,configurable:!0}),"e");class ut extends T{static{a(this,"d")}static{ct(this,"JsonReporter")}#t;#e;constructor(t={}){super(t),this.#t=F,this.#e=L}setStdout(t){this.#t=t}setStderr(t){this.#e=t}_log(t,r){const s=["error","warn"].includes(r)?this.#e:this.#t;C(t+`
11
+ `,s)}}const Rt=ut;var dt=Object.defineProperty,I=a((e,t)=>dt(e,"name",{value:t,configurable:!0}),"L");const S=I(e=>!/[\\/]pail[\\/]dist/.test(e),"pailFileFilter");class jt extends tt{static{a(this,"SimpleReporter")}static{I(this,"SimpleReporter")}#t;#e;#r;#i=!1;#s;#a;constructor(t={}){const{error:r,inspect:s,...o}=t;super({uppercase:{label:!0,...o.uppercase},...o}),this.#s={...W,indent:void 0,...s},this.#a={...r,color:{fileLine:H,hint:K,marker:v,message:v,method:N,title:v}},this.#t=F,this.#e=L}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=Y();let s=r;typeof this._styles.messageLength=="number"&&(s=this._styles.messageLength);const{badge:o,context:_,date:c,error:x,file:u,groups:m,label:f,message:d,prefix:g,repeated:R,scope:y,suffix:w,traceError:j,type:J}=t,{color:E}=this._loggerTypes[J.name],P=E?G[E]:Q,l=m.map(()=>" ").join(""),i=[];if(m.length>0&&i.push(l+h("["+m.at(-1)+"]")+" "),c&&i.push(h(this._styles.dateFormatter(typeof c=="string"?new Date(c):c))+" "),o)i.push(k(P(o)));else{const n=et(this._loggerTypes);n.length>0&&i.push(h(" ".repeat(n.length)))}const M=X(this._loggerTypes);f?i.push(k(P(q(f,this._styles)))+" "," ".repeat(M.length-$(f))):i.push(" ".repeat(M.length+1)),R&&i.push(U.white("["+R+"x]")+" "),Array.isArray(y)&&y.length>0&&i.push(h("["+y.join(" > ")+"]")+" "),g&&i.push(h("["+(this._styles.underline.prefix?A(g):g)+"]")+" ");const z=$(i.join(""));if(d!==Z){const n=typeof d=="string"?d:O(d,this.#s);i.push(l+D(n,s-3,{hard:!0,trim:!1,wordWrap:!0}))}if(_){let n=!1;i.push(..._.map(p=>{if(p instanceof Error)return n=!0,`
12
12
 
13
- `+b(p,{...this.#a,filterStacktrace:S,prefix:l});if(typeof p=="object")return" "+T(p,this.#s);const B=(n?`
13
+ `+b(p,{...this.#a,filterStacktrace:S,prefix:l});if(typeof p=="object")return" "+O(p,this.#s);const B=(n?`
14
14
 
15
- `:" ")+p;return n=!1,B}))}if(x&&i.push(b(x,{...this.#a,filterStacktrace:S,prefix:l})),E&&i.push(`
15
+ `:" ")+p;return n=!1,B}))}if(x&&i.push(b(x,{...this.#a,filterStacktrace:S,prefix:l})),j&&i.push(`
16
16
 
17
- `+b(E,{...this.#a,filterStacktrace:S,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})),w&&i.push(" "+l+h(this._styles.underline.suffix?O(w):w)),u){const n=u.name+(u.line?":"+u.line:"");i.push(`
18
- `,h("Caller: ")," ".repeat(J-8),n,`
17
+ `+b(j,{...this.#a,filterStacktrace:S,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})),w&&i.push(" "+l+h(this._styles.underline.suffix?A(w):w)),u){const n=u.name+(u.line?":"+u.line:"");i.push(`
18
+ `,h("Caller: ")," ".repeat(z-8),n,`
19
19
  `)}return i.join("")}_log(t,r){const s=["error","trace","warn"].includes(r)?"stderr":"stdout",o=s==="stderr"?this.#e:this.#t;this.#i&&this.#r!==void 0&&o.isTTY?this.#r.update(s,t.split(`
20
20
  `),0):C(t+`
21
- `,o)}}export{xt as JsonFileReporter,jt as JsonReporter,$t as PrettyReporter,Et as SimpleReporter};
21
+ `,o)}}export{xt as JsonFileReporter,Rt as JsonReporter,Mt as PrettyReporter,jt as SimpleReporter};
@@ -1,8 +1,17 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
2
  import { h as StringifyAwareReporter, g as ReadonlyMeta, e as LiteralUnion, E as ExtendedRfc5424LogLevels, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, a as DefaultLogTypes } from './pail.BGWAKixQ.cjs';
3
3
 
4
+ type AbstractJsonReporterOptions = {
5
+ error: Partial<{
6
+ exclude?: string[];
7
+ maxDepth?: number;
8
+ useToJSON?: boolean;
9
+ }>;
10
+ };
4
11
  declare abstract class AbstractJsonReporter<L extends string = string> implements StringifyAwareReporter<L> {
5
12
  protected stringify: typeof stringify | undefined;
13
+ protected errorOptions: AbstractJsonReporterOptions["error"];
14
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
6
15
  setStringify(function_: any): void;
7
16
  log(meta: ReadonlyMeta<L>): void;
8
17
  protected abstract _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -31,4 +40,4 @@ type PrettyStyleOptions = {
31
40
  };
32
41
  };
33
42
 
34
- export { AbstractJsonReporter as A, type PrettyStyleOptions as P, AbstractPrettyReporter as a };
43
+ export { AbstractJsonReporter as A, type PrettyStyleOptions as P, type AbstractJsonReporterOptions as a, AbstractPrettyReporter as b };
@@ -1,8 +1,17 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
2
  import { h as StringifyAwareReporter, g as ReadonlyMeta, e as LiteralUnion, E as ExtendedRfc5424LogLevels, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, a as DefaultLogTypes } from './pail.BGWAKixQ.mjs';
3
3
 
4
+ type AbstractJsonReporterOptions = {
5
+ error: Partial<{
6
+ exclude?: string[];
7
+ maxDepth?: number;
8
+ useToJSON?: boolean;
9
+ }>;
10
+ };
4
11
  declare abstract class AbstractJsonReporter<L extends string = string> implements StringifyAwareReporter<L> {
5
12
  protected stringify: typeof stringify | undefined;
13
+ protected errorOptions: AbstractJsonReporterOptions["error"];
14
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
6
15
  setStringify(function_: any): void;
7
16
  log(meta: ReadonlyMeta<L>): void;
8
17
  protected abstract _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -31,4 +40,4 @@ type PrettyStyleOptions = {
31
40
  };
32
41
  };
33
42
 
34
- export { AbstractJsonReporter as A, type PrettyStyleOptions as P, AbstractPrettyReporter as a };
43
+ export { AbstractJsonReporter as A, type PrettyStyleOptions as P, type AbstractJsonReporterOptions as a, AbstractPrettyReporter as b };
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var t=(r,e)=>o(r,"name",{value:e,configurable:!0});const c=require("./pail.3G15muTS.cjs"),n=require("./pail.DumOHFo9.cjs");var a=Object.defineProperty,i=t((r,e)=>a(r,"name",{value:e,configurable:!0}),"e");class u extends n.AbstractJsonReporter{static{t(this,"p")}static{i(this,"JsonReporter")}constructor(e={}){super(e)}_log(e,s){c.t(s)(e)}}const p=u;exports.i=p;
@@ -1,8 +1,17 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
2
  import { h as StringifyAwareReporter, g as ReadonlyMeta, e as LiteralUnion, E as ExtendedRfc5424LogLevels, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, a as DefaultLogTypes } from './pail.BGWAKixQ.js';
3
3
 
4
+ type AbstractJsonReporterOptions = {
5
+ error: Partial<{
6
+ exclude?: string[];
7
+ maxDepth?: number;
8
+ useToJSON?: boolean;
9
+ }>;
10
+ };
4
11
  declare abstract class AbstractJsonReporter<L extends string = string> implements StringifyAwareReporter<L> {
5
12
  protected stringify: typeof stringify | undefined;
13
+ protected errorOptions: AbstractJsonReporterOptions["error"];
14
+ constructor(options?: Partial<AbstractJsonReporterOptions>);
6
15
  setStringify(function_: any): void;
7
16
  log(meta: ReadonlyMeta<L>): void;
8
17
  protected abstract _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
@@ -31,4 +40,4 @@ type PrettyStyleOptions = {
31
40
  };
32
41
  };
33
42
 
34
- export { AbstractJsonReporter as A, type PrettyStyleOptions as P, AbstractPrettyReporter as a };
43
+ export { AbstractJsonReporter as A, type PrettyStyleOptions as P, type AbstractJsonReporterOptions as a, AbstractPrettyReporter as b };
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var e=(t,r)=>s(t,"name",{value:r,configurable:!0});import{t as a}from"./pail.BP95fgQZ.mjs";import{A as c}from"./pail.DzwLG-N9.mjs";var n=Object.defineProperty,p=e((t,r)=>n(t,"name",{value:r,configurable:!0}),"e");class i extends c{static{e(this,"p")}static{p(this,"JsonReporter")}constructor(r={}){super(r)}_log(r,o){a(o)(r)}}const u=i;export{u as i};
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var n=(s,r)=>u(s,"name",{value:r,configurable:!0});const g=require("@visulima/error/error"),f=require("./pail.BjvkVeLq.cjs");var b=Object.defineProperty,h=n((s,r)=>b(s,"name",{value:r,configurable:!0}),"p");class m{static{n(this,"AbstractJsonReporter")}static{h(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:l,file:t,message:c,type:p,...e}=r;if(e.label&&(e.label=e.label.trim()),t&&(e.file=t.name+":"+t.line+(t.column?":"+t.column:"")),c===f.EMPTY_SYMBOL?e.message=void 0:e.message=c,l&&(e.error=g.serializeError(l,this.errorOptions)),a){const i=[];for(const o of a)o!==f.EMPTY_SYMBOL&&(o instanceof Error?i.push(g.serializeError(o,this.errorOptions)):i.push(o));e.context=i}this._log(this.stringify(e),p.level)}}exports.AbstractJsonReporter=m;
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var n=(o,r)=>g(o,"name",{value:r,configurable:!0});import{serializeError as f}from"@visulima/error/error";import{E as p}from"./pail.C1VNf0a-.mjs";var h=Object.defineProperty,b=n((o,r)=>h(o,"name",{value:r,configurable:!0}),"p");class v{static{n(this,"AbstractJsonReporter")}static{b(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:l,file:t,message:c,type:m,...e}=r;if(e.label&&(e.label=e.label.trim()),t&&(e.file=t.name+":"+t.line+(t.column?":"+t.column:"")),c===p?e.message=void 0:e.message=c,l&&(e.error=f(l,this.errorOptions)),a){const i=[];for(const s of a)s!==p&&(s instanceof Error?i.push(f(s,this.errorOptions)):i.push(s));e.context=i}this._log(this.stringify(e),m.level)}}export{v as A};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pail",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Find a file or directory by walking up parent directories.",
5
5
  "keywords": [
6
6
  "ansi",
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});const n=require("./pail.3G15muTS.cjs"),c=require("./pail.DHp7NF7R.cjs");var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"t");class u extends c.p{static{r(this,"p")}static{a(this,"JsonReporter")}constructor(){super()}_log(e,s){n.t(s)(e)}}const p=u;exports.i=p;
@@ -1 +0,0 @@
1
- var g=Object.defineProperty;var l=(s,r)=>g(s,"name",{value:r,configurable:!0});import{serializeError as c}from"@visulima/error/error";import{E as m}from"./pail.C1VNf0a-.mjs";var y=Object.defineProperty,b=l((s,r)=>y(s,"name",{value:r,configurable:!0}),"f");let E=class{static{l(this,"p")}static{b(this,"AbstractJsonReporter")}stringify;setStringify(r){this.stringify=r}log(r){const{context:a,error:n,file:t,message:f,type:p,...e}=r;if(e.label&&(e.label=e.label.trim()),t&&(e.file=t.name+":"+t.line+(t.column?":"+t.column:"")),f===m?e.message=void 0:e.message=f,n&&(e.error=c(n)),a){const o=[];for(const i of a)i!==m&&(i instanceof Error?o.push(c(i)):o.push(i));e.context=o}this._log(this.stringify(e),p.level)}};export{E as p};
@@ -1 +0,0 @@
1
- "use strict";var m=Object.defineProperty;var l=(t,r)=>m(t,"name",{value:r,configurable:!0});const f=require("@visulima/error/error"),g=require("./pail.BjvkVeLq.cjs");var p=Object.defineProperty,b=l((t,r)=>p(t,"name",{value:r,configurable:!0}),"f");let y=class{static{l(this,"p")}static{b(this,"AbstractJsonReporter")}stringify;setStringify(r){this.stringify=r}log(r){const{context:n,error:a,file:s,message:c,type:u,...e}=r;if(e.label&&(e.label=e.label.trim()),s&&(e.file=s.name+":"+s.line+(s.column?":"+s.column:"")),c===g.EMPTY_SYMBOL?e.message=void 0:e.message=c,a&&(e.error=f.serializeError(a)),n){const o=[];for(const i of n)i!==g.EMPTY_SYMBOL&&(i instanceof Error?o.push(f.serializeError(i)):o.push(i));e.context=o}this._log(this.stringify(e),u.level)}};exports.p=y;
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var e=(r,t)=>s(r,"name",{value:t,configurable:!0});import{t as a}from"./pail.BP95fgQZ.mjs";import{p}from"./pail.Bbo15e5K.mjs";var n=Object.defineProperty,c=e((r,t)=>n(r,"name",{value:t,configurable:!0}),"t");class i extends p{static{e(this,"p")}static{c(this,"JsonReporter")}constructor(){super()}_log(t,o){a(o)(t)}}const u=i;export{u as i};