@visulima/pail 4.0.0-alpha.9 → 4.0.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.
Files changed (145) hide show
  1. package/CHANGELOG.md +511 -0
  2. package/LICENSE.md +270 -166
  3. package/README.md +53 -24
  4. package/dist/error.d.ts +95 -96
  5. package/dist/error.js +5 -76
  6. package/dist/index.browser.d.ts +568 -47
  7. package/dist/index.browser.js +19 -1499
  8. package/dist/index.server.d.ts +749 -65
  9. package/dist/index.server.js +32 -3179
  10. package/dist/middleware/elysia.d.ts +66 -63
  11. package/dist/middleware/elysia.js +1 -70
  12. package/dist/middleware/express.d.ts +74 -71
  13. package/dist/middleware/express.js +1 -29
  14. package/dist/middleware/fastify.d.ts +70 -67
  15. package/dist/middleware/fastify.js +1 -46
  16. package/dist/middleware/hono.d.ts +75 -72
  17. package/dist/middleware/hono.js +1 -33
  18. package/dist/middleware/next/handler.d.ts +102 -34
  19. package/dist/middleware/next/handler.js +1 -53
  20. package/dist/middleware/sveltekit.d.ts +101 -98
  21. package/dist/middleware/sveltekit.js +1 -43
  22. package/dist/object-tree.d.ts +67 -70
  23. package/dist/object-tree.js +2 -89
  24. package/dist/packem_shared/AbstractJsonReporter-Bp_JCrMQ.js +1 -0
  25. package/dist/packem_shared/AbstractJsonReporter-w_bGGiD-.js +1 -0
  26. package/dist/packem_shared/JsonReporter-Sd_lJGS-.js +2 -0
  27. package/dist/packem_shared/JsonReporter-bmem9lcg.js +1 -0
  28. package/dist/packem_shared/PailError-CbU1Ogfa.js +5 -0
  29. package/dist/packem_shared/PrettyReporter-CcDdPQSt.js +44 -0
  30. package/dist/packem_shared/PrettyReporter-DsHfKOU7.js +5 -0
  31. package/dist/packem_shared/abstract-json-reporter.d-wfESoEa-.d.ts +62 -0
  32. package/dist/packem_shared/abstract-pretty-reporter-DrLBJ6ds.js +57 -0
  33. package/dist/packem_shared/addKnownErrorConstructor-C1OJTj2D-0FlJMfXz.js +25 -0
  34. package/dist/packem_shared/constants-DKfCaSUR.js +1 -0
  35. package/dist/packem_shared/constants-ep2nsfdy.js +1 -0
  36. package/dist/packem_shared/create-middleware-logger.d-B-JmQ1Sl.d.ts +47 -0
  37. package/dist/packem_shared/headers-DH0H2s8W.js +1 -0
  38. package/dist/packem_shared/index-Q1764hvO.js +1 -0
  39. package/dist/packem_shared/index.d-T71KjNAr.d.ts +16 -0
  40. package/dist/packem_shared/pailMiddleware-B5DJoBYl.js +1 -0
  41. package/dist/packem_shared/serializeError-C-NFvZ8_-D0CA_Qlx.js +1 -0
  42. package/dist/packem_shared/storage-DaXAlpiO.js +1 -0
  43. package/dist/packem_shared/types.d-Cz9S7jZh.d.ts +201 -0
  44. package/dist/packem_shared/types.d-bWnqHJKL.d.ts +211 -0
  45. package/dist/packem_shared/types.d-xxE3FOD3.d.ts +229 -0
  46. package/dist/packem_shared/useLogger-DB34CuU5.js +1 -0
  47. package/dist/packem_shared/wide-event.d-D3ATYpoK.d.ts +717 -0
  48. package/dist/packem_shared/write-console-log-based-on-level-BqjxV016.js +1 -0
  49. package/dist/packem_shared/write-stream-C7jxLxIT.js +1 -0
  50. package/dist/processor/caller/caller-processor.d.ts +50 -47
  51. package/dist/processor/caller/caller-processor.js +1 -59
  52. package/dist/processor/environment-processor.d.ts +114 -113
  53. package/dist/processor/environment-processor.js +1 -78
  54. package/dist/processor/message-formatter-processor.d.ts +59 -49
  55. package/dist/processor/message-formatter-processor.js +1 -713
  56. package/dist/processor/opentelemetry-processor.d.ts +70 -66
  57. package/dist/processor/opentelemetry-processor.js +1 -52
  58. package/dist/processor/redact-processor.d.ts +99 -41
  59. package/dist/processor/redact-processor.js +1 -30
  60. package/dist/processor/sampling-processor.d.ts +103 -101
  61. package/dist/processor/sampling-processor.js +1 -59
  62. package/dist/reporter/file/json-file-reporter.d.ts +109 -42
  63. package/dist/reporter/file/json-file-reporter.js +2 -136
  64. package/dist/reporter/http/abstract-http-reporter.d.ts +256 -211
  65. package/dist/reporter/http/abstract-http-reporter.js +2 -435
  66. package/dist/reporter/http/http-reporter.d.ts +41 -36
  67. package/dist/reporter/http/http-reporter.edge-light.d.ts +487 -39
  68. package/dist/reporter/http/http-reporter.edge-light.js +2 -733
  69. package/dist/reporter/http/http-reporter.js +1 -13
  70. package/dist/reporter/json/index.browser.d.ts +98 -3
  71. package/dist/reporter/json/index.browser.js +1 -2
  72. package/dist/reporter/json/index.d.ts +53 -3
  73. package/dist/reporter/json/index.js +1 -2
  74. package/dist/reporter/pretty/index.browser.d.ts +105 -2
  75. package/dist/reporter/pretty/index.browser.js +1 -1
  76. package/dist/reporter/pretty/index.d.ts +270 -2
  77. package/dist/reporter/pretty/index.js +1 -1
  78. package/dist/reporter/simple/simple-reporter.server.d.ts +215 -18
  79. package/dist/reporter/simple/simple-reporter.server.js +8 -182
  80. package/dist/wide-event.d.ts +6 -300
  81. package/dist/wide-event.js +1 -281
  82. package/package.json +22 -37
  83. package/dist/constants.d.ts +0 -37
  84. package/dist/interactive/index.d.ts +0 -2
  85. package/dist/interactive/index.js +0 -2
  86. package/dist/interactive/interactive-manager.d.ts +0 -108
  87. package/dist/interactive/interactive-stream-hook.d.ts +0 -68
  88. package/dist/middleware/next/middleware.d.ts +0 -59
  89. package/dist/middleware/next/storage.d.ts +0 -14
  90. package/dist/middleware/shared/create-middleware-logger.d.ts +0 -82
  91. package/dist/middleware/shared/headers.d.ts +0 -14
  92. package/dist/middleware/shared/routes.d.ts +0 -30
  93. package/dist/middleware/shared/storage.d.ts +0 -29
  94. package/dist/packem_shared/AbstractJsonReporter-CGKHS8_M.js +0 -286
  95. package/dist/packem_shared/AbstractJsonReporter-DDjDkciI.js +0 -286
  96. package/dist/packem_shared/InteractiveManager-Cd6A14ZK.js +0 -172
  97. package/dist/packem_shared/InteractiveStreamHook-ePIURL_U.js +0 -133
  98. package/dist/packem_shared/JsonReporter-B3XX8GHN.js +0 -58
  99. package/dist/packem_shared/JsonReporter-p_BXg6Sj.js +0 -28
  100. package/dist/packem_shared/PrettyReporter-BYL3NrdA.js +0 -214
  101. package/dist/packem_shared/PrettyReporter-CvBn-hxP.js +0 -1459
  102. package/dist/packem_shared/Spinner-DIdVcfWq.js +0 -2183
  103. package/dist/packem_shared/abstract-pretty-reporter-jU8WL_6c.js +0 -2602
  104. package/dist/packem_shared/constants-B1RjD_ps.js +0 -99
  105. package/dist/packem_shared/constants-omsTHUWB.js +0 -119
  106. package/dist/packem_shared/createPailError-B11aRfrT.js +0 -76
  107. package/dist/packem_shared/getBarChar-BWj1UrH3.js +0 -404
  108. package/dist/packem_shared/headers-Cp4uLtr4.js +0 -123
  109. package/dist/packem_shared/index-DnkF86LQ.js +0 -658
  110. package/dist/packem_shared/index-frijFf5m.js +0 -1252
  111. package/dist/packem_shared/pailMiddleware-Ci88geIF.js +0 -24
  112. package/dist/packem_shared/storage-D0vqz8OX.js +0 -36
  113. package/dist/packem_shared/useLogger-D0rU3lcX.js +0 -33
  114. package/dist/packem_shared/write-console-log-based-on-level-DBmRYXpj.js +0 -14
  115. package/dist/packem_shared/write-stream-BG8fhcs3.js +0 -6
  116. package/dist/pail.browser.d.ts +0 -412
  117. package/dist/pail.server.d.ts +0 -233
  118. package/dist/processor/caller/get-caller-filename.d.ts +0 -23
  119. package/dist/progress-bar.d.ts +0 -136
  120. package/dist/progress-bar.js +0 -404
  121. package/dist/reporter/file/utils/rotating-file-stream.d.ts +0 -48
  122. package/dist/reporter/http/utils/compression.d.ts +0 -7
  123. package/dist/reporter/http/utils/log-size-error.d.ts +0 -30
  124. package/dist/reporter/http/utils/retry.d.ts +0 -27
  125. package/dist/reporter/json/abstract-json-reporter.d.ts +0 -61
  126. package/dist/reporter/json/json-reporter.browser.d.ts +0 -40
  127. package/dist/reporter/json/json-reporter.server.d.ts +0 -50
  128. package/dist/reporter/pretty/abstract-pretty-reporter.d.ts +0 -83
  129. package/dist/reporter/pretty/pretty-reporter.browser.d.ts +0 -36
  130. package/dist/reporter/pretty/pretty-reporter.server.d.ts +0 -70
  131. package/dist/reporter/raw/raw-reporter.browser.d.ts +0 -5
  132. package/dist/reporter/raw/raw-reporter.server.d.ts +0 -13
  133. package/dist/reporter/utils/default-inspector-config.d.ts +0 -3
  134. package/dist/reporter/utils/format-label.d.ts +0 -3
  135. package/dist/spinner.d.ts +0 -220
  136. package/dist/spinner.js +0 -2183
  137. package/dist/types.d.ts +0 -241
  138. package/dist/utils/ansi-escapes.d.ts +0 -4
  139. package/dist/utils/arrayify.d.ts +0 -2
  140. package/dist/utils/get-longest-badge.d.ts +0 -4
  141. package/dist/utils/get-longest-label.d.ts +0 -4
  142. package/dist/utils/merge-types.d.ts +0 -4
  143. package/dist/utils/stream/safe-stream-handler.d.ts +0 -21
  144. package/dist/utils/write-console-log-based-on-level.d.ts +0 -4
  145. package/dist/utils/write-stream.d.ts +0 -2
@@ -0,0 +1,25 @@
1
+ import{createRequire as H}from"node:module";const K=H(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=r=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,i]=w.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return w.getBuiltinModule(r)}return K(r)},{createRequire:j}=Q("node:module"),X=j(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Z=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,i]=b.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return b.getBuiltinModule(r)}return X(r)};Z("node:util");const ee=globalThis.process??Object.create(null),T={versions:{}},A=new Proxy(ee,{get(r,e){if(e in r)return r[e];if(e in T)return T[e]}}),re=r=>r.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),ie=(r,e,i,t)=>{const s={column:0,line:-1,...r.start},n={...s,...r.end},o=s.line,d=s.column,l=n.line,c=n.column;let a=Math.max(o-(i+1),0),m=Math.min(e.length,l+t);o===-1&&(a=0),l===-1&&(m=e.length);const p=l-o,f={};if(p)for(let u=0;u<=p;u++){const h=u+o;if(!d)f[h]=!0;else if(u===0){const v=e[h-1]?.length;f[h]=[d,(v??0)-d+1]}else if(u===p)f[h]=[0,c];else{const v=e[h-u]?.length;f[h]=[0,v]}}else d===c?f[o]=d?[d,0]:!0:f[o]=[d,(c??0)-(d??0)];return{end:m,markerLines:f,start:a}},te=A.platform==="win32"&&!A.env?.WT_SESSION?">":"❯",ne=(r,e,i)=>{const t={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...i,color:{gutter:u=>u,marker:u=>u,message:u=>u,...i?.color}},s=typeof e.start.column=="number";let n=(r.includes("\r")?re(r):r).split(`
3
+ `);typeof t.tabWidth=="number"&&r.includes(" ")&&(n=n.map(u=>u.replaceAll(" "," ".repeat(t.tabWidth))));const{end:o,markerLines:d,start:l}=ie(e,n,t.linesAbove,t.linesBelow),c=String(o).length,{gutter:a,marker:m,message:p}=t.color;let f=n.slice(l,o).map((u,h)=>{const v=l+1+h,E=d[v],U=String(v).padStart(c),z=!d[v+1],N=` ${U}${t.showGutter?" |":""}`;if(E){let S="";if(Array.isArray(E)){const D=u.replaceAll(/[^\t]/g," ").slice(0,Math.max(E[0]-1,0)),Y=E[1]||1;S=[`
4
+ `,t.prefix+a(N.replaceAll(/\d/g," "))," ",D,m("^").repeat(Y)].join(""),z&&t.message&&(S+=` ${p(t.message)}`)}return[t.prefix+m(te),a(N),u.length>0?` ${u}`:"",S].join("")}return`${t.prefix} ${a(N)}${u.length>0?` ${u}`:""}`}).join(`
5
+ `);return t.message&&!s&&(f=`${t.prefix+" ".repeat(c+1)+t.message}
6
+ ${f}`),f},oe=()=>A.env?.DEBUG==="true",$=(r,...e)=>{if(oe()){const i=e.map(t=>typeof t=="function"?t():t);console.debug(`error:parse-stacktrace: ${r}`,...i)}},g="<unknown>",se=/^(?:node:internal\/|node:|internal\/)/,le=r=>r!==void 0&&se.test(r),ae=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ce=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,de=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,ue=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,fe=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,me=/in\s(.*)\s\(at\s(.+)\)\sat/,pe=/^(?:.*@)?(.*):(\d+):(\d+)$/,he=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ve=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$e=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,L=/\(error: ([^)]*)\)/,ge=/at\s/,ye=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,xe=/Error: |AggregateError:/,_=/^Anonymous function$/,we=/^\s*in\s.*/,be=/^.*?\s*at\s.*/,Ee=/^.*?\s*@.*|\[native code\]/,C=(r,e)=>{const i=r.includes("safari-extension"),t=r.includes("safari-web-extension");return i||t?[r.includes("@")?r.split("@")[0]:g,i?`safari-extension:${e}`:`safari-web-extension:${e}`]:[r,e]},B=(r,e)=>{const i=de.exec(e);i&&(r.file=i[1],r.line=+i[2],r.column=+i[3])},Ne=r=>{const e=me.exec(r);if(e){$(`parse nested node error stack line: "${r}"`,()=>`found: ${JSON.stringify(e)}`);const t=e[2].split(":");return{column:t[2]?+t[2]:void 0,file:t[0],line:t[1]?+t[1]:void 0,methodName:e[1]??g,raw:r,type:void 0}}const i=fe.exec(r);if(i){$(`parse node error stack line: "${r}"`,()=>`found: ${JSON.stringify(i)}`);const t={column:i[4]?+i[4]:void 0,file:i[2]?i[2].replace(ge,""):void 0,line:i[3]?+i[3]:void 0,methodName:i[1]??g,raw:r,type:r.startsWith("internal")?"internal":void 0};return B(t,`${i[2]}:${i[3]}:${i[4]}`),t}},Se=r=>{const e=ae.exec(r);if(e){$(`parse chrome error stack line: "${r}"`,()=>`found: ${JSON.stringify(e)}`);const i=e[2]?.startsWith("native"),t=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,n;if(t){const c=ce.exec(r);if(c){const a=ye.exec(c[1]);a?(e[2]=a[4]??a[1],e[3]=a[5]??a[2],e[4]=a[3]):c[2]&&(e[2]=c[1]),c[2]&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:r,type:"eval"})}else{const a=ue.exec(r);a&&(n={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0},s={column:a[6]?+a[6]:void 0,file:a[1],line:a[5]?+a[5]:void 0,methodName:"eval",raw:a[0],type:"eval"})}}const[o,d]=C(e[1]?e[1].replace(_,"<anonymous>"):g,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:s,file:d,line:e[3]?+e[3]:void 0,methodName:o,raw:r,type:t?"eval":i?"native":le(d)?"internal":void 0};return n?(l.column=n.column,l.file=n.file,l.line=n.line):B(l,`${d}:${e[3]}:${e[4]}`),l}},Ae=(r,e)=>{const i=he.exec(r);if(i){$(`parse gecko error stack line: "${r}"`,()=>`found: ${JSON.stringify(i)}`);const t=i[3]?.includes(" > eval"),s=t&&i[3]&&ve.exec(i[3]);let n;t&&s&&(i[3]=s[1],n={column:i[5]?+i[5]:void 0,file:i[3],line:i[4]?+i[4]:void 0,methodName:"eval",raw:r,type:"eval"},i[4]=s[2]);const[o,d]=C(i[1]?i[1].replace(_,"<anonymous>"):g,i[3]);let l;(e?.type==="safari"||!t&&e?.type==="firefox")&&e.column?l=e.column:!t&&i[5]&&(l=+i[5]);let c;return(e?.type==="safari"||!t&&e?.type==="firefox")&&e.line?c=e.line:i[4]&&(c=+i[4]),{column:l,evalOrigin:n,file:d,line:c,methodName:o,raw:r,type:t?"eval":d.includes("[native code]")?"native":void 0}}},ke=(r,e)=>{const i=$e.exec(r);if(!(i&&i[2].includes(" > eval"))&&i)return $(`parse firefox error stack line: "${r}"`,()=>`found: ${JSON.stringify(i)}`),{column:i[4]?+i[4]:e?.column??void 0,file:i[2],line:i[3]?+i[3]:e?.line??void 0,methodName:i[1]||g,raw:r,type:void 0}},Me=r=>{const e=pe.exec(r);if(e)return $(`parse react android native error stack line: "${r}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:g,raw:r,type:void 0}},O=(r,{filter:e,frameLimit:i=50}={})=>{const t=r;let s=(typeof t.stacktrace=="string"?t.stacktrace:r.stack??"").split(`
7
+ `).map(n=>(L.test(n)?n.replace(L,"$1"):n).trim()).filter(n=>!xe.test(n)&&n!=="eval code");return e&&(s=s.filter(n=>e(n))),s=s.slice(0,i),s.reduce((n,o,d)=>{if(!o||o.length>1024)return n;let l;if(we.test(o))l=Ne(o);else if(be.test(o))l=Se(o);else if(Ee.test(o)){let c;if(d===0){const a=r,m=a.columnNumber,p=a.lineNumber,f=a.line,u=a.column;m||p?c={column:m,line:p,type:"firefox"}:(f||u)&&(c={column:u,line:f,type:"safari"})}l=ke(o,c)??Ae(o,c)}else l=Me(o);return l?n.push(l):$(`parse error stack line: "${o}"`,"not parser found"),n},[])},Te=j(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=r=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[e,i]=x.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return x.getBuiltinModule(r)}return Te(r)},{existsSync:Le,readFileSync:We}=k("node:fs"),{relative:je,resolve:W,sep:_e}=k("node:path"),{cwd:Ce}=x,{fileURLToPath:Be}=k("node:url"),y=(r,e,i)=>i===0?r:e===" "?r+" ".repeat(i):r+" ".repeat(e*i),R=r=>r.replaceAll("\\","/"),Oe=(r,e)=>{const i=r.replace("async file:","file:");return R(je(e,i.startsWith("file:")?Be(i):i))},Re=(r,e,i)=>{if(e)return i.title(r.message);const t=r.message?`: ${r.message}`:"";return i.title(r.name+t)},I=(r,{color:e,hideErrorTitle:i,indentation:t,prefix:s},n)=>`${y(s,t,n)}${Re(r,i,e)}
8
+ `,P=(r,{color:e,indentation:i,prefix:t},s)=>{if(r.hint===void 0)return;const n=y(t,i,s);let o="";if(Array.isArray(r.hint))for(const d of r.hint)o+=`${n+d}
9
+ `;else o+=n+r.hint;return e.hint(o)},V=(r,e)=>{if(!e||r.file===void 0||r.line===void 0)return{trace:r};try{const i=e({column:r.column,file:r.file,line:r.line});return i?{source:i.source,trace:{...r,column:i.column??r.column,file:i.file??r.file,line:i.line??r.line}}:{trace:r}}catch{return{trace:r}}},M=(r,e,i=0)=>{const{color:t,cwd:s,displayShortPath:n,indentation:o,prefix:d}=e,{trace:l}=V(r,e.sourceMap),c=n?Oe(l.file,s):R(l.file),{fileLine:a,method:m}=t;return`${y(d,o,i)}at ${l.methodName?`${m(l.methodName)} `:""}${a(c)}:${a(l.line?.toString()??"")}`},Ie=(r,e)=>{if(e.allowAllFilePaths)return!0;const i=W(e.cwd),t=W(i,r);return t===i||t.startsWith(i+_e)},G=(r,e,i)=>{const{color:t,indentation:s,linesAbove:n,linesBelow:o,prefix:d,showGutter:l,showLineNumbers:c,tabWidth:a}=e,{source:m,trace:p}=V(r,e.sourceMap);if(p.file===void 0)return;let f;if(m===void 0){const u=p.file.replace("file://","");if(!Ie(u,e)||!Le(u))return;f=We(u,"utf8")}else f=m;return ne(f,{start:{column:p.column,line:p.line}},{color:t,linesAbove:n,linesBelow:o,prefix:y(d,s,i),showGutter:l,showLineNumbers:c,tabWidth:a})},J=(r,e,i)=>{if(r.errors.length===0)return;let t=`${y(e.prefix,e.indentation,i)}Errors:
10
+
11
+ `,s=!0;for(const n of r.errors)s?s=!1:t+=`
12
+
13
+ `,t+=F(n,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},i+1);return`
14
+ ${t}`},q=(r,e,i,t=new Set)=>{t.add(r);let s=`${y(e.prefix,e.indentation,i)}Caused by:
15
+
16
+ `;const n=r.cause;s+=I(n,e,i);const o=O(n).shift(),d=P(n,e,i);if(d&&(s+=`${d}
17
+ `),o&&(s+=M(o,e,i),!e.hideErrorCauseCodeView)){const l=G(o,e,i);l!==void 0&&(s+=`
18
+ ${l}`)}if(n instanceof AggregateError){const l=J(n,e,i);l!==void 0&&(s+=`
19
+ ${l}`)}return n.cause&&(s+=t.has(n)?`
20
+ ${y(e.prefix,e.indentation,i+1)}Caused by: [Circular]`:`
21
+ ${q(n,e,i+1,t)}`),`
22
+ ${s}`},Pe=(r,e)=>(r.length>0?`
23
+ `:"")+r.map(i=>M(i,e)).join(`
24
+ `),F=(r,e,i)=>{const t={allowAllFilePaths:!1,cwd:Ce(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:o=>o,gutter:o=>o,hint:o=>o,marker:o=>o,message:o=>o,method:o=>o,title:o=>o,...e.color}},s=O(r,{filter:e.filterStacktrace,frameLimit:t.framesMaxLimit}),n=s.shift();return[e.hideMessage?void 0:I(r,t,i),P(r,t,i),n?M(n,t,i):void 0,n&&!t.hideErrorCodeView?G(n,t,i):void 0,r instanceof AggregateError?J(r,t,i):void 0,r.cause===void 0?void 0:q(r,t,i),s.length>0?Pe(s,t):void 0].filter(Boolean).join(`
25
+ `)},Je=(r,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return F(r,e,0)},Ve=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&Ve.set("AggregateError",AggregateError);export{Je as U};
@@ -0,0 +1 @@
1
+ const l={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},e={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"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},o=Symbol("EMPTY");export{o as E,e as L,l as a};
@@ -0,0 +1 @@
1
+ const l={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"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},e=Symbol("EMPTY");export{e as E,l as L};
@@ -0,0 +1,47 @@
1
+ import { P as PailBrowserImpl } from "./wide-event.d-D3ATYpoK.js";
2
+ import { D as DefaultLogTypes, L as LoggerFunction } from "./types.d-bWnqHJKL.js";
3
+ /**
4
+ * Route configuration for a specific path pattern.
5
+ */
6
+ interface RouteConfig {
7
+ /** Override the service name for requests matching this route. */
8
+ service?: string;
9
+ }
10
+ /**
11
+ * A pail instance with dynamically generated log methods.
12
+ */
13
+ type PailLike<T extends string = string> = PailBrowserImpl<T> & Record<DefaultLogTypes | T, LoggerFunction>;
14
+ /**
15
+ * Base options shared by all framework middleware adapters.
16
+ * @template T - Custom logger type names from the pail instance
17
+ */
18
+ interface PailMiddlewareOptions<T extends string = string> {
19
+ /**
20
+ * Glob patterns for paths to exclude from logging.
21
+ * Exclusions take precedence over inclusions.
22
+ * @example ["/health", "/api/_internal/**"]
23
+ */
24
+ exclude?: string[];
25
+ /**
26
+ * Glob patterns for paths to include in logging.
27
+ * If not set, all non-excluded paths are logged.
28
+ * @example ["/api/**"]
29
+ */
30
+ include?: string[];
31
+ /**
32
+ * The pail logger instance to use for wide event emission.
33
+ */
34
+ pail: PailLike<T>;
35
+ /**
36
+ * Route-specific configuration. Maps glob patterns to config.
37
+ * First matching route wins.
38
+ * @example { "/api/auth/**": { service: "auth-service" } }
39
+ */
40
+ routes?: Record<string, RouteConfig>;
41
+ /**
42
+ * Default service name for all wide events.
43
+ * Can be overridden per-route via `routes`.
44
+ */
45
+ service?: string;
46
+ }
47
+ export { PailMiddlewareOptions as P };
@@ -0,0 +1 @@
1
+ import{WideEvent as u}from"../wide-event.js";const m=s=>{let e="^",t=0;for(;t<s.length;){const r=s[t];if(r==="*"&&s[t+1]==="*")t+=2,s[t]==="/"&&(t+=1),t>=s.length&&e.endsWith("/")?e=`${e.slice(0,-1)}(/.*)?`:t>=s.length?e+=".*":e+="(.*/)?";else switch(r){case"*":{e+="[^/]*",t+=1;break}case".":{e+=String.raw`\.`,t+=1;break}case"?":{e+="[^/]",t+=1;break}default:e+=r,t+=1}}return e+="$",new RegExp(e)},l=(s,e)=>m(e).test(s),k=(s,e,t)=>t?.some(r=>l(s,r))?!1:e?.length?e.some(r=>l(s,r)):!0,x=(s,e)=>{if(!e)return;const t=Object.entries(e);for(let r=0;r<t.length;r+=1){const[a,o]=t[r];if(l(s,a))return o.service}},L=(s,e)=>{const{exclude:t,include:r,pail:a,routes:o,service:g}=s,{headers:d,method:n,path:i,requestId:p}=e;if(!k(i,r,t)){const h=new u({autoEmit:!1,name:`${n} ${i}`,pail:a});return{finish:()=>{},logger:h,skipped:!0}}const w=x(i,o)??g,c=new u({name:`${n} ${i}`,pail:a,service:w});return c.set({method:n,path:i,requestId:p,...d?{headers:d}:{}}),{finish:h=>{c.finish(h)},logger:c,skipped:!1}},f=new Set(["authorization","cookie","proxy-authorization","set-cookie","x-api-key","x-auth-token"]),$=s=>{const e={};return s.forEach((t,r)=>{f.has(r.toLowerCase())||(e[r.toLowerCase()]=t)}),e},b=s=>{const e={},t=Object.entries(s);for(let r=0;r<t.length;r+=1){const[a,o]=t[r];!f.has(a.toLowerCase())&&o!==void 0&&(e[a.toLowerCase()]=Array.isArray(o)?o.join(", "):o)}return e};export{b as a,L as c,$ as e};
@@ -0,0 +1 @@
1
+ const O=e=>{const t=Object.keys(e).map(o=>e[o].label??"");return t.length===0?"":t.reduce((o,a)=>o.length>a.length?o:a,"")};let h;const B=()=>(h!==void 0||(h=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]])),h),$=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,A=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,v=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,S=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,x=()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),y=/\s+/,m=e=>{const t=B();t.has(e)&&(e=t.get(e));const o=$.exec(e);if(o)return[Number.parseInt(o[1],16),Number.parseInt(o[2],16),Number.parseInt(o[3],16)];const a=A.exec(e);if(a)return[Number.parseInt(`${a[1]}${a[1]}`,16),Number.parseInt(`${a[2]}${a[2]}`,16),Number.parseInt(`${a[3]}${a[3]}`,16)];const c=v.exec(e);if(c)return[Math.round(Math.max(0,Math.min(255,Number(c[1])))),Math.round(Math.max(0,Math.min(255,Number(c[2])))),Math.round(Math.max(0,Math.min(255,Number(c[3]))))];const r=S.exec(e);if(r){let i=Number(r[1])%360;i<0&&(i+=360);const l=Math.max(0,Math.min(100,Number(r[2])))/100,d=Math.max(0,Math.min(100,Number(r[3])))/100,u=(1-Math.abs(2*d-1))*l,b=u*(1-Math.abs(i/60%2-1)),n=d-u/2;let s,f,g;return i<60?{0:s,1:f,2:g}=[u,b,0]:i<120?{0:s,1:f,2:g}=[b,u,0]:i<180?{0:s,1:f,2:g}=[0,u,b]:i<240?{0:s,1:f,2:g}=[0,b,u]:i<300?{0:s,1:f,2:g}=[b,0,u]:{0:s,1:f,2:g}=[u,0,b],[Math.round((s+n)*255),Math.round((f+n)*255),Math.round((g+n)*255)]}return null},k=(e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],D=e=>{if(typeof e!="string")return x();const t=x(),o=[];let a=!1,c=null,r=0,i="";for(const l of e){if(l==="(")r+=1;else if(r>0)l===")"&&(r-=1);else if(a){if(l===";"){const d=i.trim();d!==""&&o.push([c,d]),c=null,i="",a=!1;continue}}else if(l===":"){c=i.trim(),i="",a=!0;continue}i+=l}if(a&&r===0){const l=i.trim();l!==""&&o.push([c,l]),c=null,i=""}for(const{0:l,1:d}of o)switch(l){case"background-color":{d!=null&&(t.backgroundColor=d);break}case"color":{d!=null&&(t.color=d);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(d)&&(t.fontStyle="italic");break}case"font-weight":{d==="bold"&&(t.fontWeight=d);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const u=d.split(y);for(const b of u){const n=m(b);n!=null?t.textDecorationColor=n:["line-through","overline","underline"].includes(b)&&t.textDecorationLine.push(b)}break}case"text-decoration-color":{const u=m(d);u!=null&&(t.textDecorationColor=u);break}case"text-decoration-line":{t.textDecorationLine=[];const u=d.split(y);for(const b of u)["line-through","overline","underline"].includes(b)&&t.textDecorationLine.push(b);break}}return t},M=(e,t)=>{t=t??x();let o="";if(!k(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)o+="\x1B[49m";else switch(e.backgroundColor){case"black":{o+="\x1B[40m";break}case"blue":{o+="\x1B[44m";break}case"cyan":{o+="\x1B[46m";break}case"green":{o+="\x1B[42m";break}case"magenta":{o+="\x1B[45m";break}case"red":{o+="\x1B[41m";break}case"white":{o+="\x1B[47m";break}case"yellow":{o+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:a,1:c,2:r}=e.backgroundColor;o+=`\x1B[48;2;${String(a)};${String(c)};${String(r)}m`}else{const a=m(e.backgroundColor);if(a===null)o+="\x1B[49m";else{const{0:c,1:r,2:i}=a;o+=`\x1B[48;2;${String(c)};${String(r)};${String(i)}m`}}}if(!k(e.color,t.color))if(e.color==null)o+="\x1B[39m";else switch(e.color){case"black":{o+="\x1B[30m";break}case"blue":{o+="\x1B[34m";break}case"cyan":{o+="\x1B[36m";break}case"green":{o+="\x1B[32m";break}case"magenta":{o+="\x1B[35m";break}case"red":{o+="\x1B[31m";break}case"white":{o+="\x1B[37m";break}case"yellow":{o+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:a,1:c,2:r}=e.color;o+=`\x1B[38;2;${String(a)};${String(c)};${String(r)}m`}else{const a=m(e.color);if(a===null)o+="\x1B[39m";else{const{0:c,1:r,2:i}=a;o+=`\x1B[38;2;${String(c)};${String(r)};${String(i)}m`}}}if(e.fontWeight!==t.fontWeight&&(o+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(o+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!k(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)o+="\x1B[59m";else{const{0:a,1:c,2:r}=e.textDecorationColor;o+=`\x1B[58;2;${String(a)};${String(c)};${String(r)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(o+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(o+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(o+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),o},N=e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},p="%".codePointAt(0),C="s".codePointAt(0),L="d".codePointAt(0),F="f".codePointAt(0),P="i".codePointAt(0),j="O".codePointAt(0),q="o".codePointAt(0),E="j".codePointAt(0),I="c".codePointAt(0),w=(e,t=[],o={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const a=o.stringify??N,c=1;if(typeof e=="object"){const n=t.length+c;if(n===1)return"{}";const s=Array.from({length:n});s[0]=a(e);for(let f=1;f<n;f+=1)s[f]=a(t[f-c]);return s.join(" ")}if(t.length===0)return e;let r="",i=1-c,l=-1,d=!1,u;const b=o.colors??globalThis.window===void 0;for(let n=0;n<e.length;){if(e.codePointAt(n)===p&&n+1<e.length){l=l>-1?l:0;const s=e.codePointAt(n+1);switch(s){case I:{if(b){const f=D(t[i]);l<n&&(r+=e.slice(l,n));const g=M(f,u);r+=g,g!==""&&(d=!0,u=f)}l=n+2,n+=1;break}case L:case F:{const f=t[i];if(i>=t.length||f==null)break;l<n&&(r+=e.slice(l,n)),r+=(typeof f=="symbol"?Number.NaN:Number(f)).toString(),l=n+2,n+=1;break}case P:{const f=t[i];if(i>=t.length||f==null)break;l<n&&(r+=e.slice(l,n)),r+=Math.floor(typeof f=="symbol"?Number.NaN:Number(f)).toString(),l=n+2,n+=1;break}case E:case j:case q:{if(i>=t.length||t[i]===void 0)break;l<n&&(r+=e.slice(l,n));const f=t[i],g=typeof f;if(g==="string"){r+=`'${f}'`,l=n+2,n+=1;break}if(g==="function"){r+=f.name?`[Function: ${f.name}]`:"[Function: <anonymous>]",l=n+2,n+=1;break}r+=a(f),l=n+2,n+=1;break}case p:{l<n&&(r+=e.slice(l,n)),r+="%",l=n+2,n+=1,i-=1;break}case C:{if(i>=t.length)break;l<n&&(r+=e.slice(l,n));const f=t[i];r+=typeof f=="object"&&f!==null?a(f):String(f),l=n+2,n+=1;break}default:typeof o.formatters?.[s]=="function"?(l<n&&(r+=e.slice(l,n)),r+=o.formatters[s](t[i]),l=n+2,n+=1):i-=1}i+=1}n+=1}if(l===-1&&!(o.appendExtraArguments&&i<t.length))return e;if(l===-1?r=e:l<e.length&&(r+=e.slice(l)),l!==-1&&d&&(r+="\x1B[0m"),o.appendExtraArguments&&i<t.length)for(let n=Math.max(i,0);n<t.length;n+=1){const s=t[n];r+=` ${typeof s=="object"&&s!==null?a(s):String(s)}`}return r},W=(e={})=>{const t={};typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([a,c])=>{if(a.length===0)throw new Error(`Formatter %${a} has no characters`);if(a.length>1)throw new Error(`Formatter %${a} has more than one character`);if(typeof c!="function")throw new TypeError(`Formatter for %${a} is not a function`);const r=a.codePointAt(0);if(r===void 0)throw new Error(`${a}.codePointAt(0) failed to return a value, please report this issue`);t[r]=c});const o=Object.freeze({formatters:t});return(a,c=[],r)=>r===void 0?w(a,c,o):w(a,c,{...r,formatters:t})};export{W as O,O as g,w as y};
@@ -0,0 +1,16 @@
1
+ type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object);
2
+ declare function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined;
3
+ declare function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string;
4
+ declare function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined;
5
+ declare namespace stringify {
6
+ export function configure(options: StringifyOptions): typeof stringify;
7
+ }
8
+ interface StringifyOptions {
9
+ bigint?: boolean;
10
+ circularValue?: string | null | TypeErrorConstructor | ErrorConstructor;
11
+ deterministic?: boolean | ((a: string, b: string) => number);
12
+ maximumBreadth?: number;
13
+ maximumDepth?: number;
14
+ strict?: boolean;
15
+ }
16
+ export { stringify as s };
@@ -0,0 +1 @@
1
+ const o=/\*+/g,u=(s,c)=>{const{exclude:i,include:n}=c??{};return e=>{const a=e.nextUrl.pathname;if(i?.some(r=>a.startsWith(r.replaceAll(o,"")))||n?.length&&!n.some(r=>a.startsWith(r.replaceAll(o,""))))return s.next();const d=e.headers.get("x-request-id")??crypto.randomUUID(),t=new Headers(e.headers);t.set("x-request-id",d),t.set("x-pail-start",String(Date.now()));const l=s.next({request:{headers:t}});return l.headers.set("x-request-id",d),l}};export{u as pailMiddleware};
@@ -0,0 +1 @@
1
+ const p=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),y=e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},f=new WeakSet,s=e=>{const r=Object.getOwnPropertyNames(e);for(const a of r){const t=Object.getOwnPropertyDescriptor(e,a);t&&(t.enumerable||Object.defineProperty(e,a,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&s(t.value))}},m=e=>{f.add(e);const r=e.toJSON();return f.delete(e),Object.isExtensible(r)&&s(r),r},c=(e,r,a,t,u=new Set)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(a+=1,l(e,t,r,a));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(e instanceof RegExp)return e.toString();if(typeof URL<"u"&&e instanceof URL)return e.href;if(e instanceof Map){const o=[];for(const[n,i]of e.entries())o.push([c(n,r,a,t,u),c(i,r,a,t,u)]);return{__dataType:"Map",value:o}}if(e instanceof Set){const o=[];for(const n of e.values())o.push(c(n,r,a,t,u));return{__dataType:"Set",value:o}}if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(y(e)){if(u.has(e))return"[Circular]";if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=t.maxDepth)return{};a+=1,u.add(e);const o={};for(const n in e)o[n]=c(e[n],r,a,t,u);return u.delete(e),o}try{return e}catch{return"[Not Available]"}},l=(e,r,a,t)=>{if(a.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!f.has(e))return m(e);const u=Object.create(p);if(Object.defineProperty(u,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(u,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(u,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const n=[];for(const i of e.errors){if(!(i instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(i))return Object.defineProperty(u,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),u;n.push(l(i,r,a,t))}Object.defineProperty(u,"errors",{configurable:!0,enumerable:!0,value:n,writable:!0})}const o=e.cause;if(o!=null)if(o instanceof Error)a.has(o)?Object.defineProperty(u,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(u,"cause",{configurable:!0,enumerable:!0,value:l(o,r,a,t),writable:!0});else{const n=c(o,a,t,r);Object.defineProperty(u,"cause",{configurable:!0,enumerable:!0,value:n,writable:!0})}for(const n in e){if(n==="name"||n==="message"||n==="stack"||n==="cause"||n==="errors")continue;const i=e[n],b=c(i,a,t,r);Object.defineProperty(u,n,{configurable:!0,enumerable:!0,value:b,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const n of r.exclude)try{delete u[n]}catch{}return u},O=(e,r={})=>l(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0);export{O};
@@ -0,0 +1 @@
1
+ import{createRequire as t}from"node:module";const n=t(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return n(s)},{AsyncLocalStorage:c}=i("node:async_hooks"),u=s=>{const e=new c;return{storage:e,useLogger:()=>{const o=e.getStore();if(!o)throw new Error(`[pail] useLogger() called outside of ${s}`);return o}}};export{u as c};
@@ -0,0 +1,201 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { InteractiveManager } from '@visulima/interactive-manager';
3
+ import { LiteralUnion, Primitive } from 'type-fest';
4
+ /**
5
+ * Global namespace for extending Pail's metadata interface.
6
+ *
7
+ * This global declaration allows other packages and applications to extend
8
+ * the Meta interface with custom properties by declaring additional properties
9
+ * in the VisulimaPail.CustomMeta interface.
10
+ * @example
11
+ * ```typescript
12
+ * declare global {
13
+ * namespace VisulimaPail {
14
+ * interface CustomMeta<L> {
15
+ * userId?: string;
16
+ * requestId?: string;
17
+ * }
18
+ * }
19
+ * }
20
+ * ```
21
+ */
22
+ declare global {
23
+ namespace VisulimaPail {
24
+ interface CustomMeta<L> {}
25
+ }
26
+ }
27
+ /**
28
+ * Metadata object containing all information about a log entry.
29
+ *
30
+ * This interface defines the structure of metadata that is passed to reporters
31
+ * and processors. It contains all the contextual information about a log message
32
+ * including the message itself, timing information, error details, and more.
33
+ * @template L - The log level type
34
+ */
35
+ interface Meta<L> extends VisulimaPail.CustomMeta<L> {
36
+ badge: string | undefined;
37
+ context: any[] | undefined;
38
+ date: Date | string;
39
+ error: Error | undefined;
40
+ groups: string[];
41
+ label: string | undefined;
42
+ message: Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;
43
+ prefix: string | undefined;
44
+ repeated?: number;
45
+ scope: string[] | undefined;
46
+ suffix: string | undefined;
47
+ traceError: Error | undefined;
48
+ type: {
49
+ level: ExtendedRfc5424LogLevels | L;
50
+ name: string;
51
+ };
52
+ }
53
+ /**
54
+ * Extended RFC 5424 Log Levels.
55
+ *
56
+ * Standard syslog severity levels as defined in RFC 5424, plus additional
57
+ * levels commonly used in modern applications. Each level has a numeric
58
+ * priority where lower numbers indicate higher severity.
59
+ * @see https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
60
+ */
61
+ type ExtendedRfc5424LogLevels = "alert" | "critical" | "debug" | "emergency" | "error" | "informational" | "notice" | "trace" | "warning";
62
+ /**
63
+ * Default Log Types.
64
+ *
65
+ * Predefined semantic log types that provide meaningful categorization
66
+ * for different kinds of log messages. Each type has associated styling
67
+ * and log level configuration.
68
+ */
69
+ type DefaultLogTypes = "alert" | "await" | "complete" | "critical" | "debug" | "emergency" | "error" | "info" | "log" | "notice" | "pending" | "start" | "stop" | "success" | "trace" | "wait" | "warn" | "warning" | "watch";
70
+ /**
71
+ * Logger Function Type.
72
+ *
73
+ * Represents a logging function that can accept either a structured Message object
74
+ * or multiple arguments in the traditional console.log style.
75
+ */
76
+ interface LoggerFunction {
77
+ (message: Message): void;
78
+ (...message: any[]): void;
79
+ }
80
+ /**
81
+ * Logger Configuration.
82
+ *
83
+ * Configuration object that defines how a specific logger type should behave,
84
+ * including its visual appearance and log level.
85
+ * @template L - The log level type
86
+ */
87
+ interface LoggerConfiguration<L extends string> {
88
+ badge?: string;
89
+ color?: AnsiColors;
90
+ label: string;
91
+ logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
92
+ }
93
+ /**
94
+ * Logger Types Configuration.
95
+ *
96
+ * A record mapping logger type names to their configurations.
97
+ * @template T - Custom logger type names
98
+ * @template L - Log level types
99
+ */
100
+ type LoggerTypesConfig<T extends string, L extends string> = Record<T, Partial<LoggerConfiguration<L>>>;
101
+ /**
102
+ * Default Logger Types Configuration.
103
+ *
104
+ * A complete mapping of all default log types to their full configurations.
105
+ * @template L - Log level types
106
+ */
107
+ type DefaultLoggerTypes<L extends string = string> = Record<DefaultLogTypes, LoggerConfiguration<L>>;
108
+ /**
109
+ * Read-only Metadata.
110
+ *
111
+ * Immutable version of the Meta interface for use in reporters.
112
+ * @template L - The log level type
113
+ */
114
+ type ReadonlyMeta<L extends string> = Readonly<Meta<L>>;
115
+ /**
116
+ * Reporter Interface.
117
+ *
118
+ * Base interface for all reporters. Reporters are responsible for
119
+ * outputting log messages to various destinations (console, files, etc.).
120
+ * @template L - The log level type
121
+ */
122
+ interface Reporter<L extends string> {
123
+ log: (meta: ReadonlyMeta<L>) => void;
124
+ }
125
+ /**
126
+ * Stream-Aware Reporter Interface.
127
+ *
128
+ * Extends Reporter with the ability to work with Node.js streams.
129
+ * Used for server-side reporters that need to write to stdout/stderr.
130
+ * @template L - The log level type
131
+ */
132
+ interface StreamAwareReporter<L extends string> extends Reporter<L> {
133
+ /** Set the stderr stream for error output */
134
+ setStderr: (stderr: NodeJS.WriteStream) => void;
135
+ /** Set the stdout stream for standard output */
136
+ setStdout: (stdout: NodeJS.WriteStream) => void;
137
+ }
138
+ /**
139
+ * Logger Types Aware Reporter Interface.
140
+ *
141
+ * Extends Reporter with the ability to receive logger type configurations.
142
+ * Allows reporters to customize their output based on logger types.
143
+ * @template T - Custom logger type names
144
+ * @template L - The log level type
145
+ */
146
+ interface LoggerTypesAwareReporter<T extends string, L extends string> extends Reporter<L> {
147
+ /** Set the logger types configuration */
148
+ setLoggerTypes: (types: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>) => void;
149
+ }
150
+ /**
151
+ * Interactive Stream Reporter Interface.
152
+ *
153
+ * Extends StreamAwareReporter with interactive capabilities for terminal UIs.
154
+ * Supports features like progress bars and dynamic updates.
155
+ * @template L - The log level type
156
+ */
157
+ interface InteractiveStreamReporter<L extends string> extends StreamAwareReporter<L> {
158
+ /** Set the interactive manager for handling interactive output */
159
+ setInteractiveManager: (manager?: InteractiveManager) => void;
160
+ /** Enable or disable interactive mode */
161
+ setIsInteractive: (interactive: boolean) => void;
162
+ }
163
+ /**
164
+ * Processor Interface.
165
+ *
166
+ * Base interface for all processors. Processors can modify or enhance
167
+ * log metadata before it reaches reporters.
168
+ * @template L - The log level type
169
+ */
170
+ interface Processor<L extends string> {
171
+ /** Process the log metadata */
172
+ process: (meta: Meta<L>) => Meta<L>;
173
+ }
174
+ interface ConstructorOptions<T extends string, L extends string> {
175
+ disabled?: boolean;
176
+ logLevel?: LiteralUnion<ExtendedRfc5424LogLevels, L>;
177
+ logLevels?: Partial<Record<ExtendedRfc5424LogLevels, number>> & Record<L, number>;
178
+ messages?: {
179
+ timerEnd?: string;
180
+ timerStart?: string;
181
+ };
182
+ processors?: Processor<L>[];
183
+ rawReporter?: Reporter<L>;
184
+ reporters?: Reporter<L>[];
185
+ scope?: string[] | string;
186
+ throttle?: number;
187
+ throttleMin?: number;
188
+ types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
189
+ }
190
+ interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
191
+ interactive?: boolean;
192
+ stderr: NodeJS.WriteStream;
193
+ stdout: NodeJS.WriteStream;
194
+ }
195
+ type Message = {
196
+ context?: any[];
197
+ message: any;
198
+ prefix?: string;
199
+ suffix?: string;
200
+ };
201
+ export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LoggerTypesConfig as L, Meta as M, Processor as P, Reporter as R, ServerConstructorOptions as S, LoggerFunction as a, DefaultLoggerTypes as b, LoggerConfiguration as c, LoggerTypesAwareReporter as d, StreamAwareReporter as e, ReadonlyMeta as f };
@@ -0,0 +1,211 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { InteractiveManager } from '@visulima/interactive-manager';
3
+ import { Primitive, LiteralUnion } from 'type-fest';
4
+ /**
5
+ * Global namespace for extending Pail's metadata interface.
6
+ *
7
+ * This global declaration allows other packages and applications to extend
8
+ * the Meta interface with custom properties by declaring additional properties
9
+ * in the VisulimaPail.CustomMeta interface.
10
+ * @example
11
+ * ```typescript
12
+ * declare global {
13
+ * namespace VisulimaPail {
14
+ * interface CustomMeta<L> {
15
+ * userId?: string;
16
+ * requestId?: string;
17
+ * }
18
+ * }
19
+ * }
20
+ * ```
21
+ */
22
+ declare global {
23
+ namespace VisulimaPail {
24
+ interface CustomMeta<L> {}
25
+ }
26
+ }
27
+ /**
28
+ * Metadata object containing all information about a log entry.
29
+ *
30
+ * This interface defines the structure of metadata that is passed to reporters
31
+ * and processors. It contains all the contextual information about a log message
32
+ * including the message itself, timing information, error details, and more.
33
+ * @template L - The log level type
34
+ */
35
+ interface Meta<L> extends VisulimaPail.CustomMeta<L> {
36
+ badge: string | undefined;
37
+ context: any[] | undefined;
38
+ date: Date | string;
39
+ error: Error | undefined;
40
+ groups: string[];
41
+ label: string | undefined;
42
+ message: Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;
43
+ prefix: string | undefined;
44
+ repeated?: number;
45
+ scope: string[] | undefined;
46
+ suffix: string | undefined;
47
+ traceError: Error | undefined;
48
+ type: {
49
+ level: ExtendedRfc5424LogLevels | L;
50
+ name: string;
51
+ };
52
+ }
53
+ /**
54
+ * Extended RFC 5424 Log Levels.
55
+ *
56
+ * Standard syslog severity levels as defined in RFC 5424, plus additional
57
+ * levels commonly used in modern applications. Each level has a numeric
58
+ * priority where lower numbers indicate higher severity.
59
+ * @see https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
60
+ */
61
+ type ExtendedRfc5424LogLevels = "alert" | "critical" | "debug" | "emergency" | "error" | "informational" | "notice" | "trace" | "warning";
62
+ /**
63
+ * Default Log Types.
64
+ *
65
+ * Predefined semantic log types that provide meaningful categorization
66
+ * for different kinds of log messages. Each type has associated styling
67
+ * and log level configuration.
68
+ */
69
+ type DefaultLogTypes = "alert" | "await" | "complete" | "critical" | "debug" | "emergency" | "error" | "info" | "log" | "notice" | "pending" | "start" | "stop" | "success" | "trace" | "wait" | "warn" | "warning" | "watch";
70
+ /**
71
+ * Logger Function Type.
72
+ *
73
+ * Represents a logging function that can accept either a structured Message object
74
+ * or multiple arguments in the traditional console.log style.
75
+ */
76
+ interface LoggerFunction {
77
+ (message: Message): void;
78
+ (...message: any[]): void;
79
+ }
80
+ /**
81
+ * Logger Configuration.
82
+ *
83
+ * Configuration object that defines how a specific logger type should behave,
84
+ * including its visual appearance and log level.
85
+ * @template L - The log level type
86
+ */
87
+ interface LoggerConfiguration<L extends string> {
88
+ badge?: string;
89
+ color?: AnsiColors;
90
+ label: string;
91
+ logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
92
+ }
93
+ /**
94
+ * Logger Types Configuration.
95
+ *
96
+ * A record mapping logger type names to their configurations.
97
+ * @template T - Custom logger type names
98
+ * @template L - Log level types
99
+ */
100
+ type LoggerTypesConfig<T extends string, L extends string> = Record<T, Partial<LoggerConfiguration<L>>>;
101
+ /**
102
+ * Read-only Metadata.
103
+ *
104
+ * Immutable version of the Meta interface for use in reporters.
105
+ * @template L - The log level type
106
+ */
107
+ type ReadonlyMeta<L extends string> = Readonly<Meta<L>>;
108
+ /**
109
+ * Reporter Interface.
110
+ *
111
+ * Base interface for all reporters. Reporters are responsible for
112
+ * outputting log messages to various destinations (console, files, etc.).
113
+ * @template L - The log level type
114
+ */
115
+ interface Reporter<L extends string> {
116
+ log: (meta: ReadonlyMeta<L>) => void;
117
+ }
118
+ /**
119
+ * Stream-Aware Reporter Interface.
120
+ *
121
+ * Extends Reporter with the ability to work with Node.js streams.
122
+ * Used for server-side reporters that need to write to stdout/stderr.
123
+ * @template L - The log level type
124
+ */
125
+ interface StreamAwareReporter<L extends string> extends Reporter<L> {
126
+ /** Set the stderr stream for error output */
127
+ setStderr: (stderr: NodeJS.WriteStream) => void;
128
+ /** Set the stdout stream for standard output */
129
+ setStdout: (stdout: NodeJS.WriteStream) => void;
130
+ }
131
+ /**
132
+ * Logger Types Aware Reporter Interface.
133
+ *
134
+ * Extends Reporter with the ability to receive logger type configurations.
135
+ * Allows reporters to customize their output based on logger types.
136
+ * @template T - Custom logger type names
137
+ * @template L - The log level type
138
+ */
139
+ interface LoggerTypesAwareReporter<T extends string, L extends string> extends Reporter<L> {
140
+ /** Set the logger types configuration */
141
+ setLoggerTypes: (types: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>) => void;
142
+ }
143
+ /**
144
+ * Stringify-Aware Reporter Interface.
145
+ *
146
+ * Extends Reporter with the ability to receive a custom stringify function.
147
+ * Useful for reporters that need to serialize complex objects.
148
+ * @template L - The log level type
149
+ */
150
+ interface StringifyAwareReporter<L extends string> extends Reporter<L> {
151
+ /** Set the stringify function for object serialization */
152
+ setStringify: (stringify: any) => void;
153
+ }
154
+ /**
155
+ * Interactive Stream Reporter Interface.
156
+ *
157
+ * Extends StreamAwareReporter with interactive capabilities for terminal UIs.
158
+ * Supports features like progress bars and dynamic updates.
159
+ * @template L - The log level type
160
+ */
161
+ interface InteractiveStreamReporter<L extends string> extends StreamAwareReporter<L> {
162
+ /** Set the interactive manager for handling interactive output */
163
+ setInteractiveManager: (manager?: InteractiveManager) => void;
164
+ /** Enable or disable interactive mode */
165
+ setIsInteractive: (interactive: boolean) => void;
166
+ }
167
+ /**
168
+ * Processor Interface.
169
+ *
170
+ * Base interface for all processors. Processors can modify or enhance
171
+ * log metadata before it reaches reporters.
172
+ * @template L - The log level type
173
+ */
174
+ interface Processor<L extends string> {
175
+ /** Process the log metadata */
176
+ process: (meta: Meta<L>) => Meta<L>;
177
+ }
178
+ /**
179
+ * Stringify-Aware Processor Interface.
180
+ *
181
+ * Extends Processor with the ability to receive a custom stringify function.
182
+ * Useful for processors that need to serialize complex objects.
183
+ * @template L - The log level type
184
+ */
185
+ interface StringifyAwareProcessor<L extends string> extends Processor<L> {
186
+ /** Set the stringify function for object serialization */
187
+ setStringify: (stringify: typeof JSON.stringify) => void;
188
+ }
189
+ interface ConstructorOptions<T extends string, L extends string> {
190
+ disabled?: boolean;
191
+ logLevel?: LiteralUnion<ExtendedRfc5424LogLevels, L>;
192
+ logLevels?: Partial<Record<ExtendedRfc5424LogLevels, number>> & Record<L, number>;
193
+ messages?: {
194
+ timerEnd?: string;
195
+ timerStart?: string;
196
+ };
197
+ processors?: Processor<L>[];
198
+ rawReporter?: Reporter<L>;
199
+ reporters?: Reporter<L>[];
200
+ scope?: string[] | string;
201
+ throttle?: number;
202
+ throttleMin?: number;
203
+ types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
204
+ }
205
+ type Message = {
206
+ context?: any[];
207
+ message: any;
208
+ prefix?: string;
209
+ suffix?: string;
210
+ };
211
+ export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LoggerFunction as L, Meta as M, Processor as P, ReadonlyMeta as R, StringifyAwareReporter as S, StreamAwareReporter as a, StringifyAwareProcessor as b, LoggerTypesConfig as c, Reporter as d, LoggerTypesAwareReporter as e };