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