@visulima/pail 1.1.13 → 1.2.1

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 (115) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE.md +185 -0
  3. package/README.md +1 -0
  4. package/dist/index.browser.cjs +1 -16
  5. package/dist/index.browser.d.cts +5 -5
  6. package/dist/index.browser.d.mts +10 -0
  7. package/dist/index.browser.d.ts +5 -5
  8. package/dist/index.browser.mjs +1 -0
  9. package/dist/index.server.cjs +4 -20
  10. package/dist/index.server.d.cts +7 -7
  11. package/dist/index.server.d.mts +30 -0
  12. package/dist/index.server.d.ts +7 -7
  13. package/dist/index.server.mjs +5 -0
  14. package/dist/processor.browser.cjs +1 -12
  15. package/dist/processor.browser.d.cts +1 -1
  16. package/dist/processor.browser.d.mts +15 -0
  17. package/dist/processor.browser.d.ts +1 -1
  18. package/dist/processor.browser.mjs +1 -0
  19. package/dist/processor.server.cjs +1 -18
  20. package/dist/processor.server.d.cts +3 -3
  21. package/dist/processor.server.d.mts +47 -0
  22. package/dist/processor.server.d.ts +3 -3
  23. package/dist/processor.server.mjs +1 -0
  24. package/dist/reporter.browser.cjs +4 -26
  25. package/dist/reporter.browser.d.cts +4 -4
  26. package/dist/reporter.browser.d.mts +17 -0
  27. package/dist/reporter.browser.d.ts +4 -4
  28. package/dist/reporter.browser.mjs +5 -0
  29. package/dist/reporter.server.cjs +9 -24
  30. package/dist/reporter.server.d.cts +25 -18
  31. package/dist/reporter.server.d.mts +64 -0
  32. package/dist/reporter.server.d.ts +25 -18
  33. package/dist/reporter.server.mjs +19 -0
  34. package/dist/shared/pail.3G15muTS.cjs +1 -0
  35. package/dist/shared/pail.B-Tp78gL.cjs +1 -0
  36. package/dist/shared/pail.B0AqLGpo.cjs +1 -0
  37. package/dist/shared/pail.B85Cx0UJ.cjs +1 -0
  38. package/dist/shared/pail.BP95fgQZ.mjs +1 -0
  39. package/dist/shared/pail.BlF6_AB7.mjs +1 -0
  40. package/dist/{pail.browser-pg1HpChf.d.cts → shared/pail.BsONPwkb.d.mts} +3 -3
  41. package/dist/{types-DrhFTME0.d.ts → shared/pail.BxGKtnGM.d.cts} +70 -17
  42. package/dist/{types-DrhFTME0.d.cts → shared/pail.BxGKtnGM.d.mts} +70 -17
  43. package/dist/shared/pail.BxGKtnGM.d.ts +176 -0
  44. package/dist/shared/pail.Bz_4Ee-U.mjs +1 -0
  45. package/dist/shared/pail.C0epjAht.cjs +1 -0
  46. package/dist/shared/pail.CKgnzwt6.mjs +1 -0
  47. package/dist/shared/pail.CNxJnpWG.mjs +1 -0
  48. package/dist/{pail.browser-DuX9zHSz.d.ts → shared/pail.CQyMoJfJ.d.ts} +3 -3
  49. package/dist/{abstract-pretty-reporter-DwzTRutd.d.cts → shared/pail.CW2izieN.d.cts} +4 -4
  50. package/dist/shared/pail.CY7GSNwy.d.cts +58 -0
  51. package/dist/shared/pail.Cn4oOlxI.mjs +1 -0
  52. package/dist/shared/pail.CyfBrVNa.d.mts +36 -0
  53. package/dist/shared/pail.D5MfZlaK.mjs +21 -0
  54. package/dist/shared/pail.DFhaFnnA.cjs +1 -0
  55. package/dist/shared/pail.DbDZ7fkY.mjs +1 -0
  56. package/dist/shared/pail.Di3NskY9.cjs +1 -0
  57. package/dist/shared/pail.NUhULbBB.cjs +21 -0
  58. package/dist/{abstract-pretty-reporter-B-VS5gYX.d.ts → shared/pail.QGbXqfVW.d.ts} +4 -4
  59. package/dist/shared/pail.nEbRCLhY.mjs +1 -0
  60. package/dist/shared/pail.nUyAB-mN.cjs +1 -0
  61. package/package.json +55 -36
  62. package/dist/chunk-2I5JHTDY.js +0 -9
  63. package/dist/chunk-2I5JHTDY.js.map +0 -1
  64. package/dist/chunk-5MNFJRLM.cjs +0 -10
  65. package/dist/chunk-5MNFJRLM.cjs.map +0 -1
  66. package/dist/chunk-AFMDCM5W.js +0 -5
  67. package/dist/chunk-AFMDCM5W.js.map +0 -1
  68. package/dist/chunk-F4FJCQ4L.cjs +0 -9
  69. package/dist/chunk-F4FJCQ4L.cjs.map +0 -1
  70. package/dist/chunk-KERJDMYV.js +0 -8
  71. package/dist/chunk-KERJDMYV.js.map +0 -1
  72. package/dist/chunk-N2UPJYJR.cjs +0 -7
  73. package/dist/chunk-N2UPJYJR.cjs.map +0 -1
  74. package/dist/chunk-NF47XQ47.js +0 -5
  75. package/dist/chunk-NF47XQ47.js.map +0 -1
  76. package/dist/chunk-QINSQ6TU.cjs +0 -9
  77. package/dist/chunk-QINSQ6TU.cjs.map +0 -1
  78. package/dist/chunk-R5F555RP.js +0 -5
  79. package/dist/chunk-R5F555RP.js.map +0 -1
  80. package/dist/chunk-S4PFPURC.cjs +0 -45
  81. package/dist/chunk-S4PFPURC.cjs.map +0 -1
  82. package/dist/chunk-SR3Q3EUO.js +0 -7
  83. package/dist/chunk-SR3Q3EUO.js.map +0 -1
  84. package/dist/chunk-TAH23BHM.js +0 -5
  85. package/dist/chunk-TAH23BHM.js.map +0 -1
  86. package/dist/chunk-VWAGNTLB.cjs +0 -7
  87. package/dist/chunk-VWAGNTLB.cjs.map +0 -1
  88. package/dist/chunk-WHEIXCFS.js +0 -33
  89. package/dist/chunk-WHEIXCFS.js.map +0 -1
  90. package/dist/chunk-YP3U3DTV.cjs +0 -10
  91. package/dist/chunk-YP3U3DTV.cjs.map +0 -1
  92. package/dist/chunk-ZB7IIFHO.js +0 -7
  93. package/dist/chunk-ZB7IIFHO.js.map +0 -1
  94. package/dist/chunk-ZHHJ42XL.cjs +0 -12
  95. package/dist/chunk-ZHHJ42XL.cjs.map +0 -1
  96. package/dist/chunk-ZJMTPHZR.cjs +0 -7
  97. package/dist/chunk-ZJMTPHZR.cjs.map +0 -1
  98. package/dist/index.browser.cjs.map +0 -1
  99. package/dist/index.browser.js +0 -13
  100. package/dist/index.browser.js.map +0 -1
  101. package/dist/index.server.cjs.map +0 -1
  102. package/dist/index.server.js +0 -18
  103. package/dist/index.server.js.map +0 -1
  104. package/dist/processor.browser.cjs.map +0 -1
  105. package/dist/processor.browser.js +0 -3
  106. package/dist/processor.browser.js.map +0 -1
  107. package/dist/processor.server.cjs.map +0 -1
  108. package/dist/processor.server.js +0 -8
  109. package/dist/processor.server.js.map +0 -1
  110. package/dist/reporter.browser.cjs.map +0 -1
  111. package/dist/reporter.browser.js +0 -17
  112. package/dist/reporter.browser.js.map +0 -1
  113. package/dist/reporter.server.cjs.map +0 -1
  114. package/dist/reporter.server.js +0 -15
  115. package/dist/reporter.server.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { P as Processor, M as Meta } from './types-DrhFTME0.js';
1
+ import { P as Processor, M as Meta } from './shared/pail.BxGKtnGM.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;
@@ -0,0 +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,"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,27 +1,5 @@
1
- 'use strict';
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
- var chunk5MNFJRLM_cjs = require('./chunk-5MNFJRLM.cjs');
4
- var chunkN2UPJYJR_cjs = require('./chunk-N2UPJYJR.cjs');
5
- require('./chunk-ZJMTPHZR.cjs');
6
- var chunkYP3U3DTV_cjs = require('./chunk-YP3U3DTV.cjs');
7
- var chunkQINSQ6TU_cjs = require('./chunk-QINSQ6TU.cjs');
8
- var z = require('@visulima/colorize/browser');
9
- var fmt = require('@visulima/fmt');
10
-
11
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
-
13
- var z__default = /*#__PURE__*/_interopDefault(z);
14
-
15
- var m=class extends chunkYP3U3DTV_cjs.b{constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r});}log(r){let t=typeof window<"u"&&typeof window.document<"u",w=chunkN2UPJYJR_cjs.a(r.type.level),{badge:b,context:L,date:x,error:_,groups:p,label:u,message:k,prefix:f,repeated:c,scope:g,suffix:h,type:D}=r,{color:S}=this._loggerTypes[D.name],T=S?z__default.default[S]:z.white,e=[];if(t&&p.length>0){let s=p.map(()=>" ").join(""),n=z.grey("["+p.at(-1)+"]");e.push(fmt.format(s+n[0],n.slice(1)));}if(x){let s=z.grey(this._styles.dateFormatter(new Date(x)));t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)]);}if(b){let s=T(b);t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)]);}else {let s=chunkYP3U3DTV_cjs.a(this._loggerTypes);if(s.length>0){let n=z.grey(".".repeat(s.length));t?e.push(fmt.format(n[0]+" ",n.slice(1))):e.push([n[0]+" ",...n.slice(1)]);}}let v=chunkQINSQ6TU_cjs.c(this._loggerTypes),d;if(c){let s=z.white("["+c+"x]");d=t?fmt.format(s[0],s.slice(1)):[s[0],...s.slice(1)];}if(u){let s=T(this._formatLabel(u));t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]),d&&e.push(d);let n=v.length-u.length;if(c?n-=String(c).length+3:n+=1,n>0){let a=z.grey(".".repeat(n));t?e.push(fmt.format(a[0],a.slice(1))):e.push([" "+a[0],...a.slice(1)]);}}else {let s=z.grey(".".repeat(v.length+1));t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]);}if(Array.isArray(g)&&g.length>0){let s=z.grey("["+g.join(" > ")+"]");t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]);}if(f){let s=z.grey((Array.isArray(g)&&g.length>0?". ":" ")+"["+(this._styles.underline.prefix?z.underline(f):f)+"] ");t?e.push(fmt.format(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]);}if(k&&(e.push(k),L&&e.push(...L)),_&&e.push(_,`
16
-
17
- `),h){let s=z.grey(this._styles.underline.suffix?z.underline(h):h);t?e.push(fmt.format(`
18
- `+s[0],s.slice(1))):e.push([`
19
- `+s[0],...s.slice(1)]);}if(t)w(...e);else {let s="",n=[],a=[];for(let l of e)Array.isArray(l)&&l.length>1&&l[0].includes("%c")?(s+=l[0],n.push(...l.slice(1))):a.push(l);w(s+"%c",...n,"",...a);}}_formatLabel(r){let t=this._styles.uppercase.label?r.toUpperCase():r;return t=this._styles.underline.label?z.underline(t):t,this._styles.bold.label&&(t=z.bold(t)),t}};
20
-
21
- Object.defineProperty(exports, "JsonReporter", {
22
- enumerable: true,
23
- get: function () { return chunk5MNFJRLM_cjs.a; }
24
- });
25
- exports.PrettyReporter = m;
26
- //# sourceMappingURL=out.js.map
27
- //# sourceMappingURL=reporter.browser.cjs.map
3
+ `),m){const e=o.grey(this._styles.underline.suffix?o.underline(m):m);t?s.push(i.format(`
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 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 './types-DrhFTME0.cjs';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './abstract-pretty-reporter-DwzTRutd.cjs';
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BxGKtnGM.cjs';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.CW2izieN.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;
@@ -0,0 +1,17 @@
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BxGKtnGM.mjs';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.CyfBrVNa.mjs';
3
+ import '@visulima/colorize';
4
+ import 'safe-stable-stringify';
5
+
6
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> {
7
+ constructor();
8
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
9
+ }
10
+
11
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> {
12
+ constructor(options?: Partial<PrettyStyleOptions>);
13
+ log(meta: ReadonlyMeta<L>): void;
14
+ private _formatLabel;
15
+ }
16
+
17
+ export { JsonReporter, PrettyReporter };
@@ -1,14 +1,14 @@
1
- import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './types-DrhFTME0.js';
2
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './abstract-pretty-reporter-B-VS5gYX.js';
1
+ import { e as LiteralUnion, E as ExtendedRfc5424LogLevels, g as ReadonlyMeta } from './shared/pail.BxGKtnGM.js';
2
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.QGbXqfVW.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;
@@ -0,0 +1,5 @@
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
+
3
+ `),m){const e=o(this._styles.underline.suffix?_(m):m);t?s.push(i(`
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 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,26 +1,11 @@
1
- 'use strict';
1
+ "use strict";var L=Object.defineProperty;var a=(t,e)=>L(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("node:process"),l=require("./shared/pail.NUhULbBB.cjs"),z=require("./shared/pail.DFhaFnnA.cjs"),n=require("@visulima/colorize"),M=require("./shared/pail.nUyAB-mN.cjs"),I=require("./shared/pail.B0AqLGpo.cjs"),k=a(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),E=k(n);var W=Object.defineProperty,C=a((t,e)=>W(t,"name",{value:e,configurable:!0}),"i$2");let D=class{static{a(this,"s")}static{C(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 N=Object.defineProperty,G=a((t,e)=>N(t,"name",{value:e,configurable:!0}),"s$1");let w;try{w=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.")}class H{static{a(this,"l")}static{G(this,"RotatingFileStream")}#e;#t;#r;#s;constructor(e,r=!1,s={}){this.#e=e,this.#t=r,this.#s=s,this.#t||(this.#r=w(this.#e,s))}write(e){let r=this.#r;this.#t&&(r=w(this.#e,this.#s));const s=new D(r,this.#e);s.write(e),this.#t&&s.end()}end(){this.#r!==void 0&&this.#r.end()}}var Y=Object.defineProperty,B=a((t,e)=>Y(t,"name",{value:e,configurable:!0}),"r$1");class A{static{a(this,"AbstractFileReporter")}static{B(this,"AbstractFileReporter")}stream;constructor(e){const{filePath:r,writeImmediately:s=!1,...o}=e;this.stream=new H(r,s,o)}log(e){this.stream.write(this._formatMessage(e)+`
2
+ `)}}var K=Object.defineProperty,Q=a((t,e)=>K(t,"name",{value:e,configurable:!0}),"s");class U extends A{static{a(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=a((t,e)=>X(t,"name",{value:e,configurable:!0}),"r");class ee extends z.o{static{a(this,"a")}static{Z(this,"JsonReporter")}#e;#t;constructor(){super(),this.#e=d.stdout,this.#t=d.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=a((t,e)=>re(t,"name",{value:e,configurable:!0}),"R");class ie extends M.AbstractPrettyReporter{static{a(this,"q")}static{se(this,"SimpleReporter")}#e;#t;#r;#s=!1;constructor(e={}){super({uppercase:{label:!0,...e.uppercase},...e}),this.#e=d.stdout,this.#t=d.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:S,date:u,error:R,file:g,groups:m,label:f,message:y,prefix:_,repeated:j,scope:b,suffix:v,traceError:$,type:T}=e,{color:P}=this._loggerTypes[T.name],x=P?E[P]:n.white,c=m.map(()=>" ").join(""),i=[];if(m.length>0&&i.push(c+n.grey("["+m.at(-1)+"]")+" "),u&&i.push(n.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),o)i.push(n.bold(x(o)));else{const h=M.s(this._loggerTypes);h.length>0&&i.push(n.grey(" ".repeat(h.length)))}const q=I.s(this._loggerTypes);f?i.push(n.bold(x(l.n$1(f,this._styles)))+" "," ".repeat(q.length-l.stringLength(f))):i.push(" ".repeat(q.length+1)),j&&i.push(n.bgGrey.white("["+j+"x]")+" "),Array.isArray(b)&&b.length>0&&i.push(n.grey("["+b.join(" > ")+"]")+" "),_&&i.push(n.grey("["+(this._styles.underline.prefix?n.underline(_):_)+"]")+" ");const F=l.stringLength(i.join("")),O=typeof y=="string"?y:this._stringify(y);if(i.push(c+l.wrapAnsi(O??"undefined",s-3,{hard:!0,trim:!0,wordWrap:!0})),S){let h=!1;i.push(...S.map(p=>{if(p instanceof Error)return h=!0,`
2
4
 
3
- var chunkS4PFPURC_cjs = require('./chunk-S4PFPURC.cjs');
4
- var chunkZJMTPHZR_cjs = require('./chunk-ZJMTPHZR.cjs');
5
- require('./chunk-YP3U3DTV.cjs');
6
- require('./chunk-QINSQ6TU.cjs');
7
- var rotatingFileStream = require('rotating-file-stream');
8
- var c = require('process');
5
+ `+l.w(p,s,c);if(typeof p=="object")return" "+this._stringify(p);const J=(h?`
9
6
 
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
- var c__default = /*#__PURE__*/_interopDefault(c);
13
-
14
- var a=class{_ready=!0;_stream;_name;constructor(t,r){this._stream=t,this._name=r;}write(t){this.writeStream(t);}end(...t){this._stream.end(...t);}writeStream(t){if(!this._ready){console.warn("Stream busy: "+this._name+'. Write will be dropped: "'+t+'"');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(t,()=>{});}};var n=class{_filePath;_immediate;_stream;_options;constructor(t,r=!1,e={}){this._filePath=t,this._immediate=r,this._options=e,this._immediate||(this._stream=rotatingFileStream.createStream(this._filePath,e));}write(t){let r=this._stream;this._immediate&&(r=rotatingFileStream.createStream(this._filePath,this._options));let e=new a(r,this._filePath);e.write(t),this._immediate&&e.end();}end(){this._stream!==void 0&&this._stream.end();}};var s=class{_stream;constructor(t){let{filePath:r,writeImmediately:e=!1,...h}=t;this._stream=new n(r,e,h);}log(t){this._stream.write(this._formatMessage(t)+`
15
- `);}};var p=class extends s{#t;constructor(t){super({compress:"gzip",interval:"1d",size:"10M",...t});}setStringify(t){this.#t=t;}_formatMessage(t){let{type:r,...e}=t;return e.label&&(e.label=e.label.trim()),e.file&&(e.file=e.file.name+":"+e.file.line+(e.file.column?":"+e.file.column:"")),this.#t(e)}};var m=class extends chunkZJMTPHZR_cjs.a{#t;#e;constructor(){super(),this.#t=c__default.default.stdout,this.#e=c__default.default.stderr;}setStdout(t){this.#t=t;}setStderr(t){this.#e=t;}_log(t,r){let e=["error","warn"].includes(r)?this.#e:this.#t;chunkS4PFPURC_cjs.c(t+`
16
- `,e);}};
17
-
18
- Object.defineProperty(exports, "PrettyReporter", {
19
- enumerable: true,
20
- get: function () { return chunkS4PFPURC_cjs.d; }
21
- });
22
- exports.AbstractFileReporter = s;
23
- exports.JsonFileReporter = p;
24
- exports.JsonReporter = m;
25
- //# sourceMappingURL=out.js.map
26
- //# sourceMappingURL=reporter.server.cjs.map
7
+ `:" ")+p;return h=!1,J}))}if(R&&i.push(l.w(R,s,c)),$&&i.push(l.w($,s,c,!0)),v&&i.push(" "+c+n.grey(this._styles.underline.suffix?n.underline(v):v)),g){const h=g.name+(g.line?":"+g.line:"");i.push(`
8
+ `,n.grey("Caller: ")," ".repeat(F-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 ae=ie;exports.PrettyReporter=l.a;exports.AbstractFileReporter=A;exports.JsonFileReporter=V;exports.JsonReporter=te;exports.SimpleReporter=ae;
@@ -1,14 +1,11 @@
1
1
  import { Options as Options$1 } from 'rotating-file-stream';
2
- import { R as Reporter, g as ReadonlyMeta, M as Meta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './types-DrhFTME0.cjs';
3
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './abstract-pretty-reporter-DwzTRutd.cjs';
2
+ import { R as Reporter, g as ReadonlyMeta, M as Meta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './shared/pail.BxGKtnGM.cjs';
3
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.CW2izieN.cjs';
4
4
  import '@visulima/colorize';
5
5
  import 'safe-stable-stringify';
6
6
 
7
7
  declare class RotatingFileStream {
8
- private readonly _filePath;
9
- private readonly _immediate;
10
- private readonly _stream;
11
- private readonly _options;
8
+ #private;
12
9
  constructor(filePath: string, writeImmediately?: boolean, options?: Options$1);
13
10
  write(message: string): void;
14
11
  end(): void;
@@ -18,40 +15,50 @@ type Options = Options$1 & {
18
15
  filePath: string;
19
16
  writeImmediately?: boolean;
20
17
  };
21
- declare abstract class AbstractFileReporter<L extends string = never> implements Reporter<L> {
22
- protected _stream: RotatingFileStream;
18
+ declare abstract class AbstractFileReporter<L extends string = string> implements Reporter<L> {
19
+ protected stream: RotatingFileStream;
23
20
  protected constructor(options: Options);
24
21
  log(meta: ReadonlyMeta<L>): void;
25
22
  protected abstract _formatMessage(data: ReadonlyMeta<L>): string;
26
23
  }
27
24
 
28
- declare class JsonFileReporter<L extends string = never> extends AbstractFileReporter<L> {
25
+ declare class JsonFileReporter<L extends string = string> extends AbstractFileReporter<L> {
29
26
  #private;
30
27
  constructor(options: Options);
31
28
  setStringify(function_: any): void;
32
29
  protected _formatMessage(meta: Meta<L>): string;
33
30
  }
34
31
 
35
- declare class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
32
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
36
33
  #private;
37
34
  constructor();
38
- setStdout(stdout: NodeJS.WriteStream): void;
39
- setStderr(stderr: NodeJS.WriteStream): void;
35
+ setStdout(stdout_: NodeJS.WriteStream): void;
36
+ setStderr(stderr_: NodeJS.WriteStream): void;
37
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
38
+ }
39
+
40
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
41
+ #private;
42
+ constructor(options?: Partial<PrettyStyleOptions>);
43
+ setStdout(stdout_: NodeJS.WriteStream): void;
44
+ setStderr(stderr_: NodeJS.WriteStream): void;
45
+ setInteractiveManager(manager?: InteractiveManager): void;
46
+ setIsInteractive(interactive: boolean): void;
47
+ log(meta: ReadonlyMeta<L>): void;
48
+ protected _formatMessage(data: ReadonlyMeta<L>): string;
40
49
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
41
50
  }
42
51
 
43
- declare class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
52
+ declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
44
53
  #private;
45
54
  constructor(options?: Partial<PrettyStyleOptions>);
46
- setStdout(stdout: NodeJS.WriteStream): void;
47
- setStderr(stderr: NodeJS.WriteStream): void;
55
+ setStdout(stdout_: NodeJS.WriteStream): void;
56
+ setStderr(stderr_: NodeJS.WriteStream): void;
48
57
  setInteractiveManager(manager?: InteractiveManager): void;
49
58
  setIsInteractive(interactive: boolean): void;
50
59
  log(meta: ReadonlyMeta<L>): void;
51
60
  protected _formatMessage(data: ReadonlyMeta<L>): string;
52
61
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
53
- private _formatError;
54
- private _formatLabel;
55
62
  }
56
63
 
57
- export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter };
64
+ export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, SimpleReporter };
@@ -0,0 +1,64 @@
1
+ import { Options as Options$1 } from 'rotating-file-stream';
2
+ import { R as Reporter, g as ReadonlyMeta, M as Meta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './shared/pail.BxGKtnGM.mjs';
3
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.CyfBrVNa.mjs';
4
+ import '@visulima/colorize';
5
+ import 'safe-stable-stringify';
6
+
7
+ declare class RotatingFileStream {
8
+ #private;
9
+ constructor(filePath: string, writeImmediately?: boolean, options?: Options$1);
10
+ write(message: string): void;
11
+ end(): void;
12
+ }
13
+
14
+ type Options = Options$1 & {
15
+ filePath: string;
16
+ writeImmediately?: boolean;
17
+ };
18
+ declare abstract class AbstractFileReporter<L extends string = string> implements Reporter<L> {
19
+ protected stream: RotatingFileStream;
20
+ protected constructor(options: Options);
21
+ log(meta: ReadonlyMeta<L>): void;
22
+ protected abstract _formatMessage(data: ReadonlyMeta<L>): string;
23
+ }
24
+
25
+ declare class JsonFileReporter<L extends string = string> extends AbstractFileReporter<L> {
26
+ #private;
27
+ constructor(options: Options);
28
+ setStringify(function_: any): void;
29
+ protected _formatMessage(meta: Meta<L>): string;
30
+ }
31
+
32
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
33
+ #private;
34
+ constructor();
35
+ setStdout(stdout_: NodeJS.WriteStream): void;
36
+ setStderr(stderr_: NodeJS.WriteStream): void;
37
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
38
+ }
39
+
40
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
41
+ #private;
42
+ constructor(options?: Partial<PrettyStyleOptions>);
43
+ setStdout(stdout_: NodeJS.WriteStream): void;
44
+ setStderr(stderr_: NodeJS.WriteStream): void;
45
+ setInteractiveManager(manager?: InteractiveManager): void;
46
+ setIsInteractive(interactive: boolean): void;
47
+ log(meta: ReadonlyMeta<L>): void;
48
+ protected _formatMessage(data: ReadonlyMeta<L>): string;
49
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
50
+ }
51
+
52
+ declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
53
+ #private;
54
+ constructor(options?: Partial<PrettyStyleOptions>);
55
+ setStdout(stdout_: NodeJS.WriteStream): void;
56
+ setStderr(stderr_: NodeJS.WriteStream): void;
57
+ setInteractiveManager(manager?: InteractiveManager): void;
58
+ setIsInteractive(interactive: boolean): void;
59
+ log(meta: ReadonlyMeta<L>): void;
60
+ protected _formatMessage(data: ReadonlyMeta<L>): string;
61
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
62
+ }
63
+
64
+ export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, SimpleReporter };
@@ -1,14 +1,11 @@
1
1
  import { Options as Options$1 } from 'rotating-file-stream';
2
- import { R as Reporter, g as ReadonlyMeta, M as Meta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './types-DrhFTME0.js';
3
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './abstract-pretty-reporter-B-VS5gYX.js';
2
+ import { R as Reporter, g as ReadonlyMeta, M as Meta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './shared/pail.BxGKtnGM.js';
3
+ import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.QGbXqfVW.js';
4
4
  import '@visulima/colorize';
5
5
  import 'safe-stable-stringify';
6
6
 
7
7
  declare class RotatingFileStream {
8
- private readonly _filePath;
9
- private readonly _immediate;
10
- private readonly _stream;
11
- private readonly _options;
8
+ #private;
12
9
  constructor(filePath: string, writeImmediately?: boolean, options?: Options$1);
13
10
  write(message: string): void;
14
11
  end(): void;
@@ -18,40 +15,50 @@ type Options = Options$1 & {
18
15
  filePath: string;
19
16
  writeImmediately?: boolean;
20
17
  };
21
- declare abstract class AbstractFileReporter<L extends string = never> implements Reporter<L> {
22
- protected _stream: RotatingFileStream;
18
+ declare abstract class AbstractFileReporter<L extends string = string> implements Reporter<L> {
19
+ protected stream: RotatingFileStream;
23
20
  protected constructor(options: Options);
24
21
  log(meta: ReadonlyMeta<L>): void;
25
22
  protected abstract _formatMessage(data: ReadonlyMeta<L>): string;
26
23
  }
27
24
 
28
- declare class JsonFileReporter<L extends string = never> extends AbstractFileReporter<L> {
25
+ declare class JsonFileReporter<L extends string = string> extends AbstractFileReporter<L> {
29
26
  #private;
30
27
  constructor(options: Options);
31
28
  setStringify(function_: any): void;
32
29
  protected _formatMessage(meta: Meta<L>): string;
33
30
  }
34
31
 
35
- declare class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
32
+ declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
36
33
  #private;
37
34
  constructor();
38
- setStdout(stdout: NodeJS.WriteStream): void;
39
- setStderr(stderr: NodeJS.WriteStream): void;
35
+ setStdout(stdout_: NodeJS.WriteStream): void;
36
+ setStderr(stderr_: NodeJS.WriteStream): void;
37
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
38
+ }
39
+
40
+ declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
41
+ #private;
42
+ constructor(options?: Partial<PrettyStyleOptions>);
43
+ setStdout(stdout_: NodeJS.WriteStream): void;
44
+ setStderr(stderr_: NodeJS.WriteStream): void;
45
+ setInteractiveManager(manager?: InteractiveManager): void;
46
+ setIsInteractive(interactive: boolean): void;
47
+ log(meta: ReadonlyMeta<L>): void;
48
+ protected _formatMessage(data: ReadonlyMeta<L>): string;
40
49
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
41
50
  }
42
51
 
43
- declare class PrettyReporter<T extends string = never, L extends string = never> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
52
+ declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
44
53
  #private;
45
54
  constructor(options?: Partial<PrettyStyleOptions>);
46
- setStdout(stdout: NodeJS.WriteStream): void;
47
- setStderr(stderr: NodeJS.WriteStream): void;
55
+ setStdout(stdout_: NodeJS.WriteStream): void;
56
+ setStderr(stderr_: NodeJS.WriteStream): void;
48
57
  setInteractiveManager(manager?: InteractiveManager): void;
49
58
  setIsInteractive(interactive: boolean): void;
50
59
  log(meta: ReadonlyMeta<L>): void;
51
60
  protected _formatMessage(data: ReadonlyMeta<L>): string;
52
61
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
53
- private _formatError;
54
- private _formatLabel;
55
62
  }
56
63
 
57
- export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter };
64
+ export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, SimpleReporter };
@@ -0,0 +1,19 @@
1
+ var E=Object.defineProperty;var n=(s,t)=>E(s,"name",{value:t,configurable:!0});import{stdout as F,stderr as O}from"node:process";import{n as J,t as L,b as W,s as A,w as C,c as b}from"./shared/pail.D5MfZlaK.mjs";import{a as Rt}from"./shared/pail.D5MfZlaK.mjs";import{o as D}from"./shared/pail.Cn4oOlxI.mjs";import G,{white as H,grey as h,bold as M,bgGrey as N,underline as T}from"@visulima/colorize";import{A as Y,s as B}from"./shared/pail.BlF6_AB7.mjs";import{s as K}from"./shared/pail.CKgnzwt6.mjs";
2
+ // -- pack CommonJS Shims --
3
+ import __cjs_url__ from "node:url";
4
+ import __cjs_path__ from "node:path";
5
+ import __cjs_mod__ from "node:module";
6
+ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
7
+ const __dirname = __cjs_path__.dirname(__filename);
8
+ const require = __cjs_mod__.createRequire(import.meta.url);
9
+ var Q=Object.defineProperty,U=n((s,t)=>Q(s,"name",{value:t,configurable:!0}),"i$2");let V=class{static{n(this,"s")}static{U(this,"SafeStreamHandler")}_ready=!0;_stream;_name;constructor(t,e){this._stream=t,this._name=e}write(t){this.writeStream(t)}end(...t){this._stream.end(...t)}writeStream(t){if(!this._ready){console.warn("Stream busy: "+this._name+'. Write will be dropped: "'+t+'"');return}this._ready=!1,this._stream.on("error",e=>{throw e}),this._stream.on("drain",()=>{this._ready=!0}),this._stream.on("finish",()=>{this._ready=!0}),this._ready=this._stream.write(t,()=>{})}};var X=Object.defineProperty,Z=n((s,t)=>X(s,"name",{value:t,configurable:!0}),"s$1");let v;try{v=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.")}class tt{static{n(this,"l")}static{Z(this,"RotatingFileStream")}#t;#e;#s;#r;constructor(t,e=!1,r={}){this.#t=t,this.#e=e,this.#r=r,this.#e||(this.#s=v(this.#t,r))}write(t){let e=this.#s;this.#e&&(e=v(this.#t,this.#r));const r=new V(e,this.#t);r.write(t),this.#e&&r.end()}end(){this.#s!==void 0&&this.#s.end()}}var et=Object.defineProperty,st=n((s,t)=>et(s,"name",{value:t,configurable:!0}),"r$1");class rt{static{n(this,"AbstractFileReporter")}static{st(this,"AbstractFileReporter")}stream;constructor(t){const{filePath:e,writeImmediately:r=!1,...a}=t;this.stream=new tt(e,r,a)}log(t){this.stream.write(this._formatMessage(t)+`
10
+ `)}}var it=Object.defineProperty,at=n((s,t)=>it(s,"name",{value:t,configurable:!0}),"s");class nt extends rt{static{n(this,"p")}static{at(this,"JsonFileReporter")}#t;constructor(t){super({compress:"gzip",interval:"1d",size:"10M",...t})}setStringify(t){this.#t=t}_formatMessage(t){const{file:e,type:r,...a}=t;return a.label&&(a.label=a.label.trim()),e&&(a.file=e.name+":"+e.line+(e.column?":"+e.column:"")),this.#t(a)}}const wt=nt;var ot=Object.defineProperty,ht=n((s,t)=>ot(s,"name",{value:t,configurable:!0}),"r");class lt extends D{static{n(this,"a")}static{ht(this,"JsonReporter")}#t;#e;constructor(){super(),this.#t=F,this.#e=O}setStdout(t){this.#t=t}setStderr(t){this.#e=t}_log(t,e){const r=["error","warn"].includes(e)?this.#e:this.#t;J(t+`
11
+ `,r)}}const St=lt;var pt=Object.defineProperty,ct=n((s,t)=>pt(s,"name",{value:t,configurable:!0}),"R");class mt extends Y{static{n(this,"q")}static{ct(this,"SimpleReporter")}#t;#e;#s;#r=!1;constructor(t={}){super({uppercase:{label:!0,...t.uppercase},...t}),this.#t=F,this.#e=O}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:e}=L();let r=e;typeof this._styles.messageLength=="number"&&(r=this._styles.messageLength);const{badge:a,context:w,date:c,error:S,file:m,groups:u,label:d,message:f,prefix:g,repeated:$,scope:y,suffix:_,traceError:j,type:z}=t,{color:x}=this._loggerTypes[z.name],R=x?G[x]:H,l=u.map(()=>" ").join(""),i=[];if(u.length>0&&i.push(l+h("["+u.at(-1)+"]")+" "),c&&i.push(h(this._styles.dateFormatter(typeof c=="string"?new Date(c):c))+" "),a)i.push(M(R(a)));else{const o=B(this._loggerTypes);o.length>0&&i.push(h(" ".repeat(o.length)))}const P=K(this._loggerTypes);d?i.push(M(R(W(d,this._styles)))+" "," ".repeat(P.length-A(d))):i.push(" ".repeat(P.length+1)),$&&i.push(N.white("["+$+"x]")+" "),Array.isArray(y)&&y.length>0&&i.push(h("["+y.join(" > ")+"]")+" "),g&&i.push(h("["+(this._styles.underline.prefix?T(g):g)+"]")+" ");const I=A(i.join("")),k=typeof f=="string"?f:this._stringify(f);if(i.push(l+C(k??"undefined",r-3,{hard:!0,trim:!0,wordWrap:!0})),w){let o=!1;i.push(...w.map(p=>{if(p instanceof Error)return o=!0,`
12
+
13
+ `+b(p,r,l);if(typeof p=="object")return" "+this._stringify(p);const q=(o?`
14
+
15
+ `:" ")+p;return o=!1,q}))}if(S&&i.push(b(S,r,l)),j&&i.push(b(j,r,l,!0)),_&&i.push(" "+l+h(this._styles.underline.suffix?T(_):_)),m){const o=m.name+(m.line?":"+m.line:"");i.push(`
16
+ `,h("Caller: ")," ".repeat(I-8),o,`
17
+ `)}return i.join("")}_log(t,e){const r=["error","trace","warn"].includes(e)?"stderr":"stdout",a=r==="stderr"?this.#e:this.#t;this.#r&&this.#s!==void 0&&a.isTTY?this.#s.update(r,t.split(`
18
+ `),0):J(t+`
19
+ `,a)}}const $t=mt;export{rt as AbstractFileReporter,wt as JsonFileReporter,St as JsonReporter,Rt as PrettyReporter,$t as SimpleReporter};
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var r=(o,e)=>n(o,"name",{value:e,configurable:!0});var c=Object.defineProperty,l=r((o,e)=>c(o,"name",{value:e,configurable:!0}),"o");const s=l(o=>o==="error"?console.__error??console.error:o==="warn"?console.__warn??console.warn:o==="trace"?console.__trace??console.trace:console.__log??console.log,"writeConsoleLogBasedOnLevel");exports.t=s;
@@ -0,0 +1 @@
1
+ "use strict";var s=Object.defineProperty;var r=(t,e)=>s(t,"name",{value:e,configurable:!0});const n=require("./pail.3G15muTS.cjs"),c=require("./pail.DFhaFnnA.cjs");var a=Object.defineProperty,i=r((t,e)=>a(t,"name",{value:e,configurable:!0}),"t");class u extends c.o{static{r(this,"p")}static{i(this,"JsonReporter")}constructor(){super()}_log(e,o){n.t(o)(e)}}const l=u;exports.n=l;
@@ -0,0 +1 @@
1
+ "use strict";var t=Object.defineProperty;var a=(e,l)=>t(e,"name",{value:l,configurable:!0});const n={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},i={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}};var c=Object.defineProperty,g=a((e,l)=>c(e,"name",{value:l,configurable:!0}),"g");const b=g(e=>{const l=Object.keys(e).map(o=>e[o].label??"");return l.length===0?"":l.reduce((o,r)=>o.length>r.length?o:r)},"getLongestLabel");exports.EXTENDED_RFC_5424_LOG_LEVELS=n;exports.LOG_TYPES=i;exports.s=b;
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var n=(o,t)=>a(o,"name",{value:t,configurable:!0});const c=require("@visulima/fmt");var g=Object.defineProperty,f=n((o,t)=>g(o,"name",{value:t,configurable:!0}),"o");class u{static{n(this,"p")}static{f(this,"MessageFormatterProcessor")}#t;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#t=t}process(t){const e=c.build({formatters:this.#e,stringify:f(s=>{const r=this.#t(s);return r===void 0?(console.warn("Unable to stringify value of type "+typeof s,s),"undefined"):r},"stringify")});return t.message!==void 0&&(t.message=this._format(e,t.message,t.context??[])),t}_format(t,e,s=[]){if(typeof e=="string")return t(e,s);if(typeof e=="object"&&e!==null)for(const r in e){const i=e[r];(typeof i=="string"||Array.isArray(i)||typeof i=="object")&&(e[r]=this._format(t,i,s))}return e}}const y=u;exports.g=y;
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(o,e)=>n(o,"name",{value:e,configurable:!0});var c=Object.defineProperty,l=r((o,e)=>c(o,"name",{value:e,configurable:!0}),"o");const s=l(o=>o==="error"?console.__error??console.error:o==="warn"?console.__warn??console.warn:o==="trace"?console.__trace??console.trace:console.__log??console.log,"writeConsoleLogBasedOnLevel");export{s as t};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var s=(t,e)=>g(t,"name",{value:e,configurable:!0});import{L as i}from"./pail.CKgnzwt6.mjs";var n=Object.defineProperty,l=s((t,e)=>n(t,"name",{value:e,configurable:!0}),"r$1");const u=l(t=>{const e=Object.keys(t).map(r=>t[r].badge??"");return e.length===0?"":e.reduce((r,a)=>r.length>a.length?r:a)},"getLongestBadge");var c=Object.defineProperty,o=s((t,e)=>c(t,"name",{value:e,configurable:!0}),"r");const p=o(t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":"),"dateFormatter");class d{static{s(this,"AbstractPrettyReporter")}static{o(this,"AbstractPrettyReporter")}_styles;_loggerTypes;_stringify;constructor(e){this._styles={bold:{label:!1},dateFormatter:p,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this._loggerTypes=i}setStringify(e){this._stringify=e}setLoggerTypes(e){this._loggerTypes=e}}export{d as A,u as s};
@@ -1,7 +1,7 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
- import { a as DefaultLogTypes, b as LoggerFunction, C as ConstructorOptions, M as Meta, d as LoggerTypesConfig, e as LiteralUnion, P as Processor, E as ExtendedRfc5424LogLevels, R as Reporter } from './types-DrhFTME0.cjs';
2
+ import { a as DefaultLogTypes, b as LoggerFunction, C as ConstructorOptions, M as Meta, d as LoggerTypesConfig, e as LiteralUnion, P as Processor, E as ExtendedRfc5424LogLevels, R as Reporter } from './pail.BxGKtnGM.mjs';
3
3
 
4
- declare class PailBrowserImpl<T extends string = never, L extends string = never> {
4
+ declare class PailBrowserImpl<T extends string = string, L extends string = string> {
5
5
  protected timersMap: Map<string, number>;
6
6
  protected countMap: Map<string, number>;
7
7
  protected seqTimers: Set<string>;
@@ -53,6 +53,6 @@ declare class PailBrowserImpl<T extends string = never, L extends string = never
53
53
  private _buildMeta;
54
54
  private _logger;
55
55
  }
56
- type PailBrowserType<T extends string = never, L extends string = never> = PailBrowserImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = never, LC extends string = never>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);
56
+ type PailBrowserType<T extends string = string, L extends string = string> = PailBrowserImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction> & (new <TC extends string = string, LC extends string = string>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);
57
57
 
58
58
  export { type PailBrowserType as P, PailBrowserImpl as a };