Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lskjs/log

Package Overview
Dependencies
Maintainers
11
Versions
260
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lskjs/log - npm Package Compare versions

Comparing version 3.3.0 to 3.5.0

1

lib/cli.d.ts
#!/usr/bin/env node
import 'fast-safe-stringify';

4

lib/cli.js
#!/usr/bin/env node
"use strict";var Ot=Object.create;var v=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var o=(t,r)=>v(t,"name",{value:r,configurable:!0});var Nt=(t,r)=>{for(var e in r)v(t,e,{get:r[e],enumerable:!0})},S=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Wt(r))!Mt.call(t,s)&&s!==e&&v(t,s,{get:()=>r[s],enumerable:!(n=It(r,s))||n.enumerable});return t},k=(t,r,e)=>(S(t,r,"default"),e&&S(e,r,"default")),m=(t,r,e)=>(e=t!=null?Ot(At(t)):{},S(r||!t||!t.__esModule?v(e,"default",{value:t,enumerable:!0}):e,t));var xt=m(require("readline")),Lt=m(require("split")),bt=m(require("through"));var T=require("@lskjs/algos"),p=require("@lskjs/env");function D(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(D,"parseNs");var _=p.isDev||p.isClient?"pretty":"lsk",z=o(()=>{let t=(0,p.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,p.getEnvVar)("LOG_FORMAT",(0,p.getEnvVar)("DEBUG_FORMAT",_)),{on:s,off:i}=D(t),a=(0,p.getEnvVar)("LOG_LEVEL",(0,p.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,T.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var gt=require("@lskjs/algos");var E={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},G={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},B=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],C=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var f;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(f||(f={}));var g=require("@lskjs/err");var d={};Nt(d,{default:()=>U.default,stringify:()=>w.default});k(d,require("fast-safe-stringify"));var w=m(require("fast-safe-stringify")),U=m(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,w.default)(t,r,e):String(t),"toString");var V=o(t=>t.map(r=>(0,g.isError)(r)?(0,g.getCode)(r):null).filter(Boolean)[0],"getErrCode"),J=o(t=>t.length?t.map(r=>(0,g.isError)(r)?(0,g.getMessage)(r):u(r)).join(" "):null,"createMsg");var Y=require("@lskjs/env");var h=o((t,r)=>{let e=[];return t!==null&&e.push((0,Y.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var Pt={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},$t={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},H=o(t=>Boolean(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),K=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:i,v:l,...a}=t;return{format:f.bunyan,meta:{level:Pt[r],time:new Date(e)},args:h(n,a)}},"parseBunyan"),Q=o(t=>{let{level:r,time:e,...n}=t;return u({level:$t[r],time:e.toISOString(),...n})},"stringifyBunyan");var Dt=["trace","debug","info","warning","error","fatal","panic"],Tt={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},zt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},X=o(t=>Boolean(t.msg&&Dt.includes(t.level)),"isLogrus"),Z=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:f.logrus,meta:{level:Tt[r],time:new Date(e)},args:h(n,s)}},"parseLogrus"),j=o(t=>{let{level:r,time:e,...n}=t;return u({level:zt[r],time:e.toISOString(),...n})},"stringifyLogrus");var q=["trace","debug","info","warn","error","fatal"];var tt=o(t=>Boolean(q.includes(t.level)&&t.ns),"isLsklog"),rt=o(t=>Boolean(q.includes(t.level)),"isLskLikelog"),c=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),R=o(t=>Boolean(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),F=o(t=>{let{level:r,time:e,msg:n,ns:s,name:i,...l}=t,a={level:r,time:e,msg:n,ns:s,name:i};if(!c(t))return{format:f.lsklogweb,meta:a,args:h(n,l)};let{reqId:vt,method:kt,host:wt,ua:St,ip:_t,url:Et,status:Bt,length:Ct,duration:Rt,...Ft}=l;return{format:f.lsklog,meta:{...a,method:kt,host:wt,reqId:vt,ua:St,ip:_t,url:Et,status:Bt,duration:Rt,length:Ct},args:h(n,Ft)}},"parseLsklog"),et=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function Gt(t){return H(t)?f.bunyan:tt(t)?f.lsklog:c(t)?f.lsklogweb:X(t)?f.logrus:rt(t)?f.lsklog:null}o(Gt,"detectFormat");function ot(t,r,...e){let n=V(e),s=J(e),i={code:n,...r,msg:s};return t==="bunyan"?Q(i):t==="logrus"?j(i):et(i)}o(ot,"stringify");function nt(t){let r=Gt(t);return r==="bunyan"?K(t):r==="lsklogweb"?F(t):r==="lsklog"?F(t):r==="logrus"?Z(t):{format:r,meta:{},args:[t]}}o(nt,"parse");var it=require("@lskjs/colors"),lt=require("@lskjs/env"),at=m(require("pretty-bytes")),ft=m(require("pretty-time"));var I=require("@lskjs/colors");var O=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),st=O;function W(t,r){let e=B[st(r||"")%B.length]||[];return(0,I.colorize)(t,e)}o(W,"themeizeRandom");function x(t,r){let e=r?G[r]:[];return(0,I.colorize)(t,e)}o(x,"themeize");var Ut=(0,lt.getEnvVar)("LOG_VIEW","short"),L=o((t,r)=>String(t).padStart(r),"leftPad"),Vt=o((t,r)=>String(t).padEnd(r),"rightPad"),A=20,Jt=o((t,r=0)=>(A=Math.max(t&&t.length||0,A,r),Vt(t,A)),"prettyPath"),pt=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),Yt=o(t=>{let r=pt(t);return r||(r=t!==200?"log":null),x(L(String(t),3),r)},"prettyStatus"),Ht=o(t=>L(`#${t}`,3),"prettyReqId"),Kt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return x(L(t,4),r)},"prettyMethod"),Qt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,ft.default)(i,s);return x(L(l,5),e)},"prettyTime"),Xt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,at.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),ut=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function Zt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[O(t)%r.length];return W(e,String(t))}o(Zt,"prettyMarker");var M=o(t=>{let r=Ut==="short"?(t[0]||"").toLowerCase():L(t,5);return r=`[${r}]`,x(r,t)},"prettyLevel"),jt=/\[[^"\]]+]/gm,ct=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(jt,s=>(0,it.colorize)(s,C[n++%C.length])))}else r.push(e)}),r},"prettyContent"),qt=o(t=>pt(t.status)||R(t)?"debug":"trace","getUrlLevel"),mt=o(t=>{let r=R(t),e=qt(t);return[M(e),[Zt(t.reqId),Kt(t.method)].join(""),Jt(t.url),Ht(t.reqId),r&&t.method!=="WS"?Yt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Qt(t.duration),r&&t.method!=="WS"?Xt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function tr(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(tr,"countInRow");function rr(...t){let r=tr(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(rr,"concatFirstStrings");function y(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(c(t))return[mt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[M(s)];return(l.length||n)&&a.push(ut(l,n)),rr(...a,...ct(...i))}o(y,"prettyFormat");function N(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(N,"anyRegExps");var b=class{format=_;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!E[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return E[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&N(this.off,this.ns)?!1:this.ns&&N(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(c(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,gt.omitNull)(i);if(this.format==="pretty"){this.log(...y(a,...l));return}this.log(ot(this.format||"lsk",a,...l))}};o(b,"Logger");var P=new b(z());var yt=require("@lskjs/env");var ht=require("@lskjs/algos");var er=require("logfmt"),dt=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=er.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,ht.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var $=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,yt.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=dt(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...y({},r));return}if(typeof e!="object"){t.log(...y({},e));return}let{meta:s,args:i=[]}=nt(e);t.log(...y(s,...i))},"prettyRawLog");process.env.LSK_LOG_READLINE!=="0"?xt.default.createInterface({input:process.stdin}).on("line",t=>{$(P,t)}):process.stdin.pipe((0,Lt.default)()).pipe((0,bt.default)(function(t){if(!t){this.emit("data",`${t}
`);return}$(P,t)})).pipe(process.stdout);
"use strict";var Ot=Object.create;var v=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var o=(t,r)=>v(t,"name",{value:r,configurable:!0});var Pt=(t,r)=>{for(var e in r)v(t,e,{get:r[e],enumerable:!0})},_=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Wt(r))!Mt.call(t,s)&&s!==e&&v(t,s,{get:()=>r[s],enumerable:!(n=It(r,s))||n.enumerable});return t},k=(t,r,e)=>(_(t,r,"default"),e&&_(e,r,"default")),m=(t,r,e)=>(e=t!=null?Ot(At(t)):{},_(r||!t||!t.__esModule?v(e,"default",{value:t,enumerable:!0}):e,t));var xt=m(require("readline")),Lt=m(require("split")),bt=m(require("through"));var z=require("@lskjs/algos"),p=require("@lskjs/env");function T(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(T,"parseNs");var E=p.isDev||p.isClient?"pretty":"lsk",w=o(()=>{let t=(0,p.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,p.getEnvVar)("LOG_FORMAT",(0,p.getEnvVar)("DEBUG_FORMAT",E)),{on:s,off:i}=T(t),a=(0,p.getEnvVar)("LOG_LEVEL",(0,p.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,z.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var gt=require("@lskjs/algos");var B={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},G={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},C=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],R=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var f;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(f||(f={}));var g=require("@lskjs/err");var d={};Pt(d,{default:()=>U.default,stringify:()=>S.default});k(d,require("fast-safe-stringify"));var S=m(require("fast-safe-stringify")),U=m(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,S.default)(t,r,e):String(t),"toString");var V=o(t=>t.map(r=>(0,g.isError)(r)?(0,g.getCode)(r):null).filter(Boolean)[0],"getErrCode"),J=o(t=>t.length?t.map(r=>(0,g.isError)(r)?(0,g.getMessage)(r):u(r)).join(" "):null,"createMsg");var Y=require("@lskjs/env");var h=o((t,r)=>{let e=[];return t!==null&&e.push((0,Y.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var Nt={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},$t={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},H=o(t=>!!(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),K=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:i,v:l,...a}=t;return{format:f.bunyan,meta:{level:Nt[r],time:new Date(e)},args:h(n,a)}},"parseBunyan"),Q=o(t=>{let{level:r,time:e,...n}=t;return u({level:$t[r],time:e.toISOString(),...n})},"stringifyBunyan");var Dt=["trace","debug","info","warning","error","fatal","panic"],Tt={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},zt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},X=o(t=>!!(t.msg&&Dt.includes(t.level)),"isLogrus"),Z=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:f.logrus,meta:{level:Tt[r],time:new Date(e)},args:h(n,s)}},"parseLogrus"),j=o(t=>{let{level:r,time:e,...n}=t;return u({level:zt[r],time:e.toISOString(),...n})},"stringifyLogrus");var q=["trace","debug","info","warn","error","fatal"];var tt=o(t=>!!(q.includes(t.level)&&t.ns),"isLsklog"),rt=o(t=>!!q.includes(t.level),"isLskLikelog"),c=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),F=o(t=>!!(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),O=o(t=>{let{level:r,time:e,msg:n,ns:s,name:i,...l}=t,a={level:r,time:e,msg:n,ns:s,name:i};if(!c(t))return{format:f.lsklogweb,meta:a,args:h(n,l)};let{reqId:vt,method:kt,host:wt,ua:St,ip:_t,url:Et,status:Bt,length:Ct,duration:Rt,...Ft}=l;return{format:f.lsklog,meta:{...a,method:kt,host:wt,reqId:vt,ua:St,ip:_t,url:Et,status:Bt,duration:Rt,length:Ct},args:h(n,Ft)}},"parseLsklog"),et=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function Gt(t){return H(t)?f.bunyan:tt(t)?f.lsklog:c(t)?f.lsklogweb:X(t)?f.logrus:rt(t)?f.lsklog:null}o(Gt,"detectFormat");function ot(t,r,...e){let n=V(e),s=J(e),i={code:n,...r,msg:s};return t==="bunyan"?Q(i):t==="logrus"?j(i):et(i)}o(ot,"stringify");function nt(t){let r=Gt(t);return r==="bunyan"?K(t):r==="lsklogweb"?O(t):r==="lsklog"?O(t):r==="logrus"?Z(t):{format:r,meta:{},args:[t]}}o(nt,"parse");var it=require("@lskjs/colors"),lt=require("@lskjs/env"),at=m(require("pretty-bytes")),ft=m(require("pretty-time"));var W=require("@lskjs/colors");var I=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),st=I;function A(t,r){let e=C[st(r||"")%C.length]||[];return(0,W.colorize)(t,e)}o(A,"themeizeRandom");function x(t,r){let e=r?G[r]:[];return(0,W.colorize)(t,e)}o(x,"themeize");var Ut=(0,lt.getEnvVar)("LOG_VIEW","short"),L=o((t,r)=>String(t).padStart(r),"leftPad"),Vt=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,Jt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),Vt(t,M)),"prettyPath"),pt=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),Yt=o(t=>{let r=pt(t);return r||(r=t!==200?"log":null),x(L(String(t),3),r)},"prettyStatus"),Ht=o(t=>L(`#${t}`,3),"prettyReqId"),Kt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return x(L(t,4),r)},"prettyMethod"),Qt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,ft.default)(i,s);return x(L(l,5),e)},"prettyTime"),Xt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,at.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),ut=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>A(n,n)).join(":"),"prettyNs");function Zt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[I(t)%r.length];return A(e,String(t))}o(Zt,"prettyMarker");var P=o(t=>{let r=Ut==="short"?(t[0]||"").toLowerCase():L(t,5);return r=`[${r}]`,x(r,t)},"prettyLevel"),jt=/\[[^"\]]+]/gm,ct=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(jt,s=>(0,it.colorize)(s,R[n++%R.length])))}else r.push(e)}),r},"prettyContent"),qt=o(t=>pt(t.status)||F(t)?"debug":"trace","getUrlLevel"),mt=o(t=>{let r=F(t),e=qt(t);return[P(e),[Zt(t.reqId),Kt(t.method)].join(""),Jt(t.url),Ht(t.reqId),r&&t.method!=="WS"?Yt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Qt(t.duration),r&&t.method!=="WS"?Xt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function tr(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(tr,"countInRow");function rr(...t){let r=tr(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(rr,"concatFirstStrings");function y(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(c(t))return[mt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[P(s)];return(l.length||n)&&a.push(ut(l,n)),rr(...a,...ct(...i))}o(y,"prettyFormat");function N(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(N,"anyRegExps");var b=class{prefix;ns;name;format=E;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...w()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!B[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return B[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&N(this.off,this.ns)?!1:this.ns&&N(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(c(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,gt.omitNull)(i);if(this.format==="pretty"){this.log(...y(a,...l));return}this.log(ot(this.format||"lsk",a,...l))}};o(b,"Logger");var $=new b(w());var yt=require("@lskjs/env");var ht=require("@lskjs/algos");var er=require("logfmt"),dt=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=er.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,ht.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var D=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,yt.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=dt(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...y({},r));return}if(typeof e!="object"){t.log(...y({},e));return}let{meta:s,args:i=[]}=nt(e);t.log(...y(s,...i))},"prettyRawLog");process.env.LSK_LOG_READLINE!=="0"?xt.default.createInterface({input:process.stdin}).on("line",t=>{D($,t)}):process.stdin.pipe((0,Lt.default)()).pipe((0,bt.default)(function(t){if(!t){this.emit("data",`${t}
`);return}D($,t)})).pipe(process.stdout);
//# sourceMappingURL=cli.js.map

@@ -1,2 +0,2 @@

"use strict";var et=Object.create;var m=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var o=(t,r)=>m(t,"name",{value:r,configurable:!0});var I=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of nt(r))!it.call(t,s)&&s!==e&&m(t,s,{get:()=>r[s],enumerable:!(n=ot(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?et(st(t)):{},b(r||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),lt=t=>b(m({},"__esModule",{value:!0}),t);var _t={};I(_t,{Logger:()=>y,default:()=>B});module.exports=lt(_t);var rt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var at=require("@lskjs/algos"),h=require("@lskjs/env");var O=h.isDev||h.isClient?"pretty":"lsk";var c;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(c||(c={}));var u=require("@lskjs/err");var p={};I(p,{default:()=>P.default,stringify:()=>k.default});L(p,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),P=v(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var $=o(t=>t.map(r=>(0,u.isError)(r)?(0,u.getCode)(r):null).filter(Boolean)[0],"getErrCode"),T=o(t=>t.length?t.map(r=>(0,u.isError)(r)?(0,u.getMessage)(r):f(r)).join(" "):null,"createMsg");var ft=require("@lskjs/env");var ut={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var D=o(t=>{let{level:r,time:e,...n}=t;return f({level:ut[r],time:e.toISOString(),...n})},"stringifyBunyan");var ct={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var G=o(t=>{let{level:r,time:e,...n}=t;return f({level:ct[r],time:e.toISOString(),...n})},"stringifyLogrus");var g=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),E=o(t=>Boolean(g(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var U=o(t=>{let{level:r,time:e,...n}=t;return f({level:r,time:+e,...n})},"stringifyLsklog");function V(t,r,...e){let n=$(e),s=T(e),i={code:n,...r,msg:s};return t==="bunyan"?D(i):t==="logrus"?G(i):U(i)}o(V,"stringify");var Y=require("@lskjs/colors"),H=require("@lskjs/env"),Q=v(require("pretty-bytes")),X=v(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),J=C;function W(t,r){let e=S[J(r||"")%S.length]||[];return(0,F.colorize)(t,e)}o(W,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,F.colorize)(t,e)}o(d,"themeize");var pt=(0,H.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),gt=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,mt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),gt(t,M)),"prettyPath"),Z=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),ht=o(t=>{let r=Z(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),dt=o(t=>x(`#${t}`,3),"prettyReqId"),xt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),yt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,X.default)(i,s);return d(x(l,5),e)},"prettyTime"),bt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Q.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),K=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function Lt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return W(e,String(t))}o(Lt,"prettyMarker");var R=o(t=>{let r=pt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),vt=/\[[^"\]]+]/gm,j=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(vt,s=>(0,Y.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),kt=o(t=>Z(t.status)||E(t)?"debug":"trace","getUrlLevel"),q=o(t=>{let r=E(t),e=kt(t);return[R(e),[Lt(t.reqId),xt(t.method)].join(""),mt(t.url),dt(t.reqId),r&&t.method!=="WS"?ht(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&yt(t.duration),r&&t.method!=="WS"?bt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function wt(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(wt,"countInRow");function St(...t){let r=wt(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(St,"concatFirstStrings");function tt(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(g(t))return[q(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[R(s)];return(l.length||n)&&a.push(K(l,n)),St(...a,...j(...i))}o(tt,"prettyFormat");function A(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(A,"anyRegExps");var y=class{format=O;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&A(this.off,this.ns)?!1:this.ns&&A(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(g(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,rt.omitNull)(i);if(this.format==="pretty"){this.log(...tt(a,...l));return}this.log(V(this.format||"lsk",a,...l))}};o(y,"Logger");var B=y;0&&(module.exports={Logger});
"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var P=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Et={};P(Et,{Logger:()=>y,default:()=>E});module.exports=ut(Et);var nt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var $=require("@lskjs/algos"),f=require("@lskjs/env");function O(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(O,"parseNs");var B=f.isDev||f.isClient?"pretty":"lsk",T=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",B)),{on:s,off:i}=O(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,$.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var p;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(p||(p={}));var c=require("@lskjs/err");var g={};P(g,{default:()=>z.default,stringify:()=>k.default});L(g,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),z=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var D=o(t=>t.map(r=>(0,c.isError)(r)?(0,c.getCode)(r):null).filter(Boolean)[0],"getErrCode"),G=o(t=>t.length?t.map(r=>(0,c.isError)(r)?(0,c.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var Y=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function H(t,r,...e){let n=D(e),s=G(e),i={code:n,...r,msg:s};return t==="bunyan"?V(i):t==="logrus"?J(i):Y(i)}o(H,"stringify");var X=require("@lskjs/colors"),Z=require("@lskjs/env"),K=v(require("pretty-bytes")),j=v(require("pretty-time"));var W=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),Q=F;function M(t,r){let e=S[Q(r||"")%S.length]||[];return(0,W.colorize)(t,e)}o(M,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,W.colorize)(t,e)}o(d,"themeize");var mt=(0,Z.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,dt=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),ht(t,R)),"prettyPath"),q=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=q(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,j.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,K.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),tt=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>M(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return M(e,String(t))}o(kt,"prettyMarker");var A=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,rt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,X.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>q(t.status)||C(t)?"debug":"trace","getUrlLevel"),et=o(t=>{let r=C(t),e=St(t);return[A(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function ot(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[et(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[A(s)];return(l.length||n)&&a.push(tt(l,n)),Bt(...a,...rt(...i))}o(ot,"prettyFormat");function I(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(I,"anyRegExps");var y=class{prefix;ns;name;format=B;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...T()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&I(this.off,this.ns)?!1:this.ns&&I(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,nt.omitNull)(i);if(this.format==="pretty"){this.log(...ot(a,...l));return}this.log(H(this.format||"lsk",a,...l))}};o(y,"Logger");var E=y;0&&(module.exports={Logger});
//# sourceMappingURL=client.js.map

@@ -1,2 +0,2 @@

"use strict";var nt=Object.create;var h=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var I=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of it(r))!at.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=st(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?nt(lt(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ft=t=>b(h({},"__esModule",{value:!0}),t);var Et={};I(Et,{ILoggerInternalMessageFormat:()=>c,Logger:()=>y,default:()=>ot,defaultFormat:()=>k,getEnvConfig:()=>ut});module.exports=ft(Et);var c;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(c||(c={}));var et=require("@lskjs/algos");var S={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},_=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],B=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var P=require("@lskjs/algos"),f=require("@lskjs/env");function O(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(O,"parseNs");var k=f.isDev||f.isClient?"pretty":"lsk",ut=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",k)),{on:s,off:i}=O(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,P.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var p=require("@lskjs/err");var g={};I(g,{default:()=>$.default,stringify:()=>w.default});L(g,require("fast-safe-stringify"));var w=v(require("fast-safe-stringify")),$=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,w.default)(t,r,e):String(t),"toString");var T=o(t=>t.map(r=>(0,p.isError)(r)?(0,p.getCode)(r):null).filter(Boolean)[0],"getErrCode"),z=o(t=>t.length?t.map(r=>(0,p.isError)(r)?(0,p.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var G=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var U=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),E=o(t=>Boolean(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function J(t,r,...e){let n=T(e),s=z(e),i={code:n,...r,msg:s};return t==="bunyan"?G(i):t==="logrus"?U(i):V(i)}o(J,"stringify");var H=require("@lskjs/colors"),Q=require("@lskjs/env"),X=v(require("pretty-bytes")),Z=v(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),Y=C;function W(t,r){let e=_[Y(r||"")%_.length]||[];return(0,F.colorize)(t,e)}o(W,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,F.colorize)(t,e)}o(d,"themeize");var mt=(0,Q.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,dt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),ht(t,M)),"prettyPath"),K=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=K(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,Z.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,X.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),j=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return W(e,String(t))}o(kt,"prettyMarker");var R=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,q=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,H.colorize)(s,B[n++%B.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>K(t.status)||E(t)?"debug":"trace","getUrlLevel"),tt=o(t=>{let r=E(t),e=St(t);return[R(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function rt(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[tt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[R(s)];return(l.length||n)&&a.push(j(l,n)),Bt(...a,...q(...i))}o(rt,"prettyFormat");function A(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(A,"anyRegExps");var y=class{format=k;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!S[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return S[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&A(this.off,this.ns)?!1:this.ns&&A(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,et.omitNull)(i);if(this.format==="pretty"){this.log(...rt(a,...l));return}this.log(J(this.format||"lsk",a,...l))}};o(y,"Logger");var ot=y;0&&(module.exports={ILoggerInternalMessageFormat,Logger,defaultFormat,getEnvConfig});
"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var P=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Et={};P(Et,{ILoggerInternalMessageFormat:()=>c,Logger:()=>y,default:()=>nt,defaultFormat:()=>k,getEnvConfig:()=>E});module.exports=ut(Et);var c;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(c||(c={}));var ot=require("@lskjs/algos");var S={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},_=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],B=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var $=require("@lskjs/algos"),f=require("@lskjs/env");function O(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(O,"parseNs");var k=f.isDev||f.isClient?"pretty":"lsk",E=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",k)),{on:s,off:i}=O(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,$.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var p=require("@lskjs/err");var g={};P(g,{default:()=>T.default,stringify:()=>w.default});L(g,require("fast-safe-stringify"));var w=v(require("fast-safe-stringify")),T=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,w.default)(t,r,e):String(t),"toString");var z=o(t=>t.map(r=>(0,p.isError)(r)?(0,p.getCode)(r):null).filter(Boolean)[0],"getErrCode"),D=o(t=>t.length?t.map(r=>(0,p.isError)(r)?(0,p.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var U=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function Y(t,r,...e){let n=z(e),s=D(e),i={code:n,...r,msg:s};return t==="bunyan"?U(i):t==="logrus"?V(i):J(i)}o(Y,"stringify");var Q=require("@lskjs/colors"),X=require("@lskjs/env"),Z=v(require("pretty-bytes")),K=v(require("pretty-time"));var W=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),H=F;function M(t,r){let e=_[H(r||"")%_.length]||[];return(0,W.colorize)(t,e)}o(M,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,W.colorize)(t,e)}o(d,"themeize");var mt=(0,X.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,dt=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),ht(t,R)),"prettyPath"),j=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=j(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,K.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Z.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),q=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>M(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return M(e,String(t))}o(kt,"prettyMarker");var A=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,tt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,Q.colorize)(s,B[n++%B.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>j(t.status)||C(t)?"debug":"trace","getUrlLevel"),rt=o(t=>{let r=C(t),e=St(t);return[A(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function et(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[rt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[A(s)];return(l.length||n)&&a.push(q(l,n)),Bt(...a,...tt(...i))}o(et,"prettyFormat");function I(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(I,"anyRegExps");var y=class{prefix;ns;name;format=k;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...E()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!S[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return S[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&I(this.off,this.ns)?!1:this.ns&&I(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,ot.omitNull)(i);if(this.format==="pretty"){this.log(...et(a,...l));return}this.log(Y(this.format||"lsk",a,...l))}};o(y,"Logger");var nt=y;0&&(module.exports={ILoggerInternalMessageFormat,Logger,defaultFormat,getEnvConfig});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var I=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Ct={};I(Ct,{default:()=>Et,log:()=>nt});module.exports=ut(Ct);var O=require("@lskjs/algos"),f=require("@lskjs/env");function N(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(N,"parseNs");var w=f.isDev||f.isClient?"pretty":"lsk",P=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",w)),{on:s,off:i}=N(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,O.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var ot=require("@lskjs/algos");var S={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},$={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},_=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],B=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var p;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(p||(p={}));var c=require("@lskjs/err");var g={};I(g,{default:()=>T.default,stringify:()=>k.default});L(g,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),T=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var z=o(t=>t.map(r=>(0,c.isError)(r)?(0,c.getCode)(r):null).filter(Boolean)[0],"getErrCode"),D=o(t=>t.length?t.map(r=>(0,c.isError)(r)?(0,c.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var U=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),E=o(t=>Boolean(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function Y(t,r,...e){let n=z(e),s=D(e),i={code:n,...r,msg:s};return t==="bunyan"?U(i):t==="logrus"?V(i):J(i)}o(Y,"stringify");var Q=require("@lskjs/colors"),X=require("@lskjs/env"),Z=v(require("pretty-bytes")),K=v(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),H=C;function W(t,r){let e=_[H(r||"")%_.length]||[];return(0,F.colorize)(t,e)}o(W,"themeizeRandom");function d(t,r){let e=r?$[r]:[];return(0,F.colorize)(t,e)}o(d,"themeize");var mt=(0,X.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,dt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),ht(t,M)),"prettyPath"),j=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=j(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,K.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Z.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),q=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return W(e,String(t))}o(kt,"prettyMarker");var R=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,tt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,Q.colorize)(s,B[n++%B.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>j(t.status)||E(t)?"debug":"trace","getUrlLevel"),rt=o(t=>{let r=E(t),e=St(t);return[R(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function et(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[rt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[R(s)];return(l.length||n)&&a.push(q(l,n)),Bt(...a,...tt(...i))}o(et,"prettyFormat");function A(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(A,"anyRegExps");var y=class{format=w;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!S[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return S[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&A(this.off,this.ns)?!1:this.ns&&A(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,ot.omitNull)(i);if(this.format==="pretty"){this.log(...et(a,...l));return}this.log(Y(this.format||"lsk",a,...l))}};o(y,"Logger");var nt=new y(P()),Et=nt;0&&(module.exports={log});
"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var P=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Ct={};P(Ct,{default:()=>Bt,log:()=>nt});module.exports=ut(Ct);var O=require("@lskjs/algos"),f=require("@lskjs/env");function N(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(N,"parseNs");var S=f.isDev||f.isClient?"pretty":"lsk",k=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",S)),{on:s,off:i}=N(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,O.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var ot=require("@lskjs/algos");var _={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},$={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},E=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],B=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var p;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(p||(p={}));var c=require("@lskjs/err");var g={};P(g,{default:()=>T.default,stringify:()=>w.default});L(g,require("fast-safe-stringify"));var w=v(require("fast-safe-stringify")),T=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,w.default)(t,r,e):String(t),"toString");var z=o(t=>t.map(r=>(0,c.isError)(r)?(0,c.getCode)(r):null).filter(Boolean)[0],"getErrCode"),D=o(t=>t.length?t.map(r=>(0,c.isError)(r)?(0,c.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var U=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function Y(t,r,...e){let n=z(e),s=D(e),i={code:n,...r,msg:s};return t==="bunyan"?U(i):t==="logrus"?V(i):J(i)}o(Y,"stringify");var Q=require("@lskjs/colors"),X=require("@lskjs/env"),Z=v(require("pretty-bytes")),K=v(require("pretty-time"));var W=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),H=F;function M(t,r){let e=E[H(r||"")%E.length]||[];return(0,W.colorize)(t,e)}o(M,"themeizeRandom");function d(t,r){let e=r?$[r]:[];return(0,W.colorize)(t,e)}o(d,"themeize");var mt=(0,X.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,dt=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),ht(t,R)),"prettyPath"),j=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=j(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,K.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Z.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),q=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>M(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return M(e,String(t))}o(kt,"prettyMarker");var A=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,tt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,Q.colorize)(s,B[n++%B.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>j(t.status)||C(t)?"debug":"trace","getUrlLevel"),rt=o(t=>{let r=C(t),e=St(t);return[A(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Et(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Et,"concatFirstStrings");function et(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[rt(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[A(s)];return(l.length||n)&&a.push(q(l,n)),Et(...a,...tt(...i))}o(et,"prettyFormat");function I(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(I,"anyRegExps");var y=class{prefix;ns;name;format=S;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...k()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!_[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return _[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&I(this.off,this.ns)?!1:this.ns&&I(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,ot.omitNull)(i);if(this.format==="pretty"){this.log(...et(a,...l));return}this.log(Y(this.format||"lsk",a,...l))}};o(y,"Logger");var nt=new y(k()),Bt=nt;0&&(module.exports={log});
//# sourceMappingURL=log.js.map

@@ -12,3 +12,3 @@ import { ILogger, LoggerLevelType, ILoggerProps } from './types.js';

off: RegExp[];
constructor(props?: ILoggerProps);
constructor(props?: ILoggerProps | string);
setProps({ prefix, ns, name, level, format, on, off }: ILoggerProps): void;

@@ -15,0 +15,0 @@ static create(props: ILoggerProps): ILogger;

@@ -1,2 +0,2 @@

"use strict";var et=Object.create;var m=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var o=(t,r)=>m(t,"name",{value:r,configurable:!0});var A=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of nt(r))!it.call(t,s)&&s!==e&&m(t,s,{get:()=>r[s],enumerable:!(n=ot(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?et(st(t)):{},b(r||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),lt=t=>b(m({},"__esModule",{value:!0}),t);var _t={};A(_t,{Logger:()=>y,default:()=>T});module.exports=lt(_t);var rt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},I={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var at=require("@lskjs/algos"),h=require("@lskjs/env");var N=h.isDev||h.isClient?"pretty":"lsk";var c;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(c||(c={}));var u=require("@lskjs/err");var p={};A(p,{default:()=>O.default,stringify:()=>k.default});L(p,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),O=v(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var P=o(t=>t.map(r=>(0,u.isError)(r)?(0,u.getCode)(r):null).filter(Boolean)[0],"getErrCode"),$=o(t=>t.length?t.map(r=>(0,u.isError)(r)?(0,u.getMessage)(r):f(r)).join(" "):null,"createMsg");var ft=require("@lskjs/env");var ut={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var D=o(t=>{let{level:r,time:e,...n}=t;return f({level:ut[r],time:e.toISOString(),...n})},"stringifyBunyan");var ct={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var G=o(t=>{let{level:r,time:e,...n}=t;return f({level:ct[r],time:e.toISOString(),...n})},"stringifyLogrus");var g=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),B=o(t=>Boolean(g(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var U=o(t=>{let{level:r,time:e,...n}=t;return f({level:r,time:+e,...n})},"stringifyLsklog");function V(t,r,...e){let n=P(e),s=$(e),i={code:n,...r,msg:s};return t==="bunyan"?D(i):t==="logrus"?G(i):U(i)}o(V,"stringify");var Y=require("@lskjs/colors"),H=require("@lskjs/env"),Q=v(require("pretty-bytes")),X=v(require("pretty-time"));var C=require("@lskjs/colors");var E=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),J=E;function F(t,r){let e=S[J(r||"")%S.length]||[];return(0,C.colorize)(t,e)}o(F,"themeizeRandom");function d(t,r){let e=r?I[r]:[];return(0,C.colorize)(t,e)}o(d,"themeize");var pt=(0,H.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),gt=o((t,r)=>String(t).padEnd(r),"rightPad"),W=20,mt=o((t,r=0)=>(W=Math.max(t&&t.length||0,W,r),gt(t,W)),"prettyPath"),Z=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),ht=o(t=>{let r=Z(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),dt=o(t=>x(`#${t}`,3),"prettyReqId"),xt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),yt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,X.default)(i,s);return d(x(l,5),e)},"prettyTime"),bt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Q.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),K=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>F(n,n)).join(":"),"prettyNs");function Lt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[E(t)%r.length];return F(e,String(t))}o(Lt,"prettyMarker");var M=o(t=>{let r=pt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),vt=/\[[^"\]]+]/gm,j=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(vt,s=>(0,Y.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),kt=o(t=>Z(t.status)||B(t)?"debug":"trace","getUrlLevel"),q=o(t=>{let r=B(t),e=kt(t);return[M(e),[Lt(t.reqId),xt(t.method)].join(""),mt(t.url),dt(t.reqId),r&&t.method!=="WS"?ht(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&yt(t.duration),r&&t.method!=="WS"?bt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function wt(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(wt,"countInRow");function St(...t){let r=wt(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(St,"concatFirstStrings");function tt(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(g(t))return[q(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[M(s)];return(l.length||n)&&a.push(K(l,n)),St(...a,...j(...i))}o(tt,"prettyFormat");function R(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(R,"anyRegExps");var y=class{format=N;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&R(this.off,this.ns)?!1:this.ns&&R(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(g(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,rt.omitNull)(i);if(this.format==="pretty"){this.log(...tt(a,...l));return}this.log(V(this.format||"lsk",a,...l))}};o(y,"Logger");var T=y;0&&(module.exports={Logger});
"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var I=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Et={};I(Et,{Logger:()=>y,default:()=>G});module.exports=ut(Et);var nt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},P={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var O=require("@lskjs/algos"),f=require("@lskjs/env");function N(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(N,"parseNs");var B=f.isDev||f.isClient?"pretty":"lsk",$=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",B)),{on:s,off:i}=N(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,O.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var p;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(p||(p={}));var c=require("@lskjs/err");var g={};I(g,{default:()=>T.default,stringify:()=>k.default});L(g,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),T=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var z=o(t=>t.map(r=>(0,c.isError)(r)?(0,c.getCode)(r):null).filter(Boolean)[0],"getErrCode"),D=o(t=>t.length?t.map(r=>(0,c.isError)(r)?(0,c.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),E=o(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var Y=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function H(t,r,...e){let n=z(e),s=D(e),i={code:n,...r,msg:s};return t==="bunyan"?V(i):t==="logrus"?J(i):Y(i)}o(H,"stringify");var X=require("@lskjs/colors"),Z=require("@lskjs/env"),K=v(require("pretty-bytes")),j=v(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),Q=C;function W(t,r){let e=S[Q(r||"")%S.length]||[];return(0,F.colorize)(t,e)}o(W,"themeizeRandom");function d(t,r){let e=r?P[r]:[];return(0,F.colorize)(t,e)}o(d,"themeize");var mt=(0,Z.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,dt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),ht(t,M)),"prettyPath"),q=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=q(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,j.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,K.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),tt=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return W(e,String(t))}o(kt,"prettyMarker");var R=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,rt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,X.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>q(t.status)||E(t)?"debug":"trace","getUrlLevel"),et=o(t=>{let r=E(t),e=St(t);return[R(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function ot(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[et(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[R(s)];return(l.length||n)&&a.push(tt(l,n)),Bt(...a,...rt(...i))}o(ot,"prettyFormat");function A(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(A,"anyRegExps");var y=class{prefix;ns;name;format=B;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...$()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&A(this.off,this.ns)?!1:this.ns&&A(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,nt.omitNull)(i);if(this.format==="pretty"){this.log(...ot(a,...l));return}this.log(H(this.format||"lsk",a,...l))}};o(y,"Logger");var G=y;0&&(module.exports={Logger});
//# sourceMappingURL=Logger.js.map

@@ -1,2 +0,2 @@

"use strict";var B=Object.create;var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var x=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of C(r))!W.call(t,i)&&i!==e&&a(t,i,{get:()=>r[i],enumerable:!(s=E(r,i))||s.enumerable});return t},c=(t,r,e)=>(u(t,r,"default"),e&&u(e,r,"default")),p=(t,r,e)=>(e=t!=null?B(F(t)):{},u(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),M=t=>u(a({},"__esModule",{value:!0}),t);var D={};x(D,{bunyanLevels:()=>$,isBunyan:()=>v,parseBunyan:()=>k,stringifyBunyan:()=>w});module.exports=M(D);var n;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(n||(n={}));var P=require("@lskjs/algos");var R=require("@lskjs/algos"),h=require("@lskjs/env");var d=require("@lskjs/err");var l={};x(l,{default:()=>y.default,stringify:()=>g.default});c(l,require("fast-safe-stringify"));var g=p(require("fast-safe-stringify")),y=p(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,g.default)(t,r,e):String(t),"toString");var b=require("@lskjs/env");var m=o((t,r)=>{let e=[];return t!==null&&e.push((0,b.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var I=require("@lskjs/colors"),S=require("@lskjs/env"),N=p(require("pretty-bytes")),O=p(require("pretty-time"));var A=require("@lskjs/colors");var jt=(0,S.getEnvVar)("LOG_VIEW","short");var $=[10,20,30,40,50,60],T={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},z={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},v=o(t=>Boolean(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),k=o(t=>{let{level:r,time:e,msg:s,hostname:i,pid:G,v:U,..._}=t;return{format:n.bunyan,meta:{level:T[r],time:new Date(e)},args:m(s,_)}},"parseBunyan"),w=o(t=>{let{level:r,time:e,...s}=t;return f({level:z[r],time:e.toISOString(),...s})},"stringifyBunyan");0&&(module.exports={bunyanLevels,isBunyan,parseBunyan,stringifyBunyan});
"use strict";var B=Object.create;var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var x=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of C(r))!W.call(t,i)&&i!==e&&a(t,i,{get:()=>r[i],enumerable:!(s=E(r,i))||s.enumerable});return t},c=(t,r,e)=>(u(t,r,"default"),e&&u(e,r,"default")),p=(t,r,e)=>(e=t!=null?B(F(t)):{},u(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),M=t=>u(a({},"__esModule",{value:!0}),t);var D={};x(D,{bunyanLevels:()=>$,isBunyan:()=>v,parseBunyan:()=>k,stringifyBunyan:()=>w});module.exports=M(D);var n;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(n||(n={}));var O=require("@lskjs/algos");var R=require("@lskjs/algos"),h=require("@lskjs/env");var d=require("@lskjs/err");var l={};x(l,{default:()=>y.default,stringify:()=>g.default});c(l,require("fast-safe-stringify"));var g=p(require("fast-safe-stringify")),y=p(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,g.default)(t,r,e):String(t),"toString");var b=require("@lskjs/env");var m=o((t,r)=>{let e=[];return t!==null&&e.push((0,b.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var I=require("@lskjs/colors"),S=require("@lskjs/env"),P=p(require("pretty-bytes")),N=p(require("pretty-time"));var A=require("@lskjs/colors");var jt=(0,S.getEnvVar)("LOG_VIEW","short");var $=[10,20,30,40,50,60],T={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},z={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},v=o(t=>!!(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),k=o(t=>{let{level:r,time:e,msg:s,hostname:i,pid:G,v:U,..._}=t;return{format:n.bunyan,meta:{level:T[r],time:new Date(e)},args:m(s,_)}},"parseBunyan"),w=o(t=>{let{level:r,time:e,...s}=t;return f({level:z[r],time:e.toISOString(),...s})},"stringifyBunyan");0&&(module.exports={bunyanLevels,isBunyan,parseBunyan,stringifyBunyan});
//# sourceMappingURL=bunyan.js.map

@@ -1,2 +0,2 @@

"use strict";var Z=Object.create;var p=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var e=(t,r)=>p(t,"name",{value:r,configurable:!0});var k=(t,r)=>{for(var o in r)p(t,o,{get:r[o],enumerable:!0})},h=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of j(r))!tt.call(t,i)&&i!==o&&p(t,i,{get:()=>r[i],enumerable:!(n=K(r,i))||n.enumerable});return t},d=(t,r,o)=>(h(t,r,"default"),o&&h(o,r,"default")),x=(t,r,o)=>(o=t!=null?Z(q(t)):{},h(r||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>h(p({},"__esModule",{value:!0}),t);var mt={};k(mt,{detectFormat:()=>T,parse:()=>gt,stringify:()=>R});module.exports=rt(mt);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var a=require("@lskjs/err");var c={};k(c,{default:()=>w.default,stringify:()=>y.default});d(c,require("fast-safe-stringify"));var y=x(require("fast-safe-stringify")),w=x(require("fast-safe-stringify"));var l=e((t,r=null,o=0)=>typeof t=="object"?(0,y.default)(t,r,o):String(t),"toString");var S=e(t=>t.map(r=>(0,a.isError)(r)?(0,a.getCode)(r):null).filter(Boolean)[0],"getErrCode"),_=e(t=>t.length?t.map(r=>(0,a.isError)(r)?(0,a.getMessage)(r):l(r)).join(" "):null,"createMsg");var lt=require("@lskjs/algos");var et=require("@lskjs/algos"),L=require("@lskjs/env");var B=require("@lskjs/env");var f=e((t,r)=>{let o=[];return t!==null&&o.push((0,B.tryJSONparse)(t)),Object.keys(r).length&&o.push(r),o},"parseArgs");var E=["trace","debug","info","warn","error","fatal"];var C=e(t=>Boolean(E.includes(t.level)&&t.ns),"isLsklog"),F=e(t=>Boolean(E.includes(t.level)),"isLskLikelog"),g=e(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb");var v=e(t=>{let{level:r,time:o,msg:n,ns:i,name:u,...b}=t,m={level:r,time:o,msg:n,ns:i,name:u};if(!g(t))return{format:s.lsklogweb,meta:m,args:f(n,b)};let{reqId:z,method:D,host:G,ua:U,ip:V,url:J,status:Y,length:H,duration:Q,...X}=b;return{format:s.lsklog,meta:{...m,method:D,host:G,reqId:z,ua:U,ip:V,url:J,status:Y,duration:Q,length:H},args:f(n,X)}},"parseLsklog"),W=e(t=>{let{level:r,time:o,...n}=t;return l({level:r,time:+o,...n})},"stringifyLsklog");var nt=require("@lskjs/colors"),M=require("@lskjs/env"),st=x(require("pretty-bytes")),it=x(require("pretty-time"));var ot=require("@lskjs/colors");var er=(0,M.getEnvVar)("LOG_VIEW","short");var at={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},ft={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},A=e(t=>Boolean(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),I=e(t=>{let{level:r,time:o,msg:n,hostname:i,pid:u,v:b,...m}=t;return{format:s.bunyan,meta:{level:at[r],time:new Date(o)},args:f(n,m)}},"parseBunyan"),N=e(t=>{let{level:r,time:o,...n}=t;return l({level:ft[r],time:o.toISOString(),...n})},"stringifyBunyan");var ut=["trace","debug","info","warning","error","fatal","panic"],ct={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},pt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},O=e(t=>Boolean(t.msg&&ut.includes(t.level)),"isLogrus"),P=e(t=>{let{level:r,time:o,msg:n,...i}=t;return{format:s.logrus,meta:{level:ct[r],time:new Date(o)},args:f(n,i)}},"parseLogrus"),$=e(t=>{let{level:r,time:o,...n}=t;return l({level:pt[r],time:o.toISOString(),...n})},"stringifyLogrus");function T(t){return A(t)?s.bunyan:C(t)?s.lsklog:g(t)?s.lsklogweb:O(t)?s.logrus:F(t)?s.lsklog:null}e(T,"detectFormat");function R(t,r,...o){let n=S(o),i=_(o),u={code:n,...r,msg:i};return t==="bunyan"?N(u):t==="logrus"?$(u):W(u)}e(R,"stringify");function gt(t){let r=T(t);return r==="bunyan"?I(t):r==="lsklogweb"?v(t):r==="lsklog"?v(t):r==="logrus"?P(t):{format:r,meta:{},args:[t]}}e(gt,"parse");0&&(module.exports={detectFormat,parse,stringify});
"use strict";var Z=Object.create;var p=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var e=(t,r)=>p(t,"name",{value:r,configurable:!0});var k=(t,r)=>{for(var o in r)p(t,o,{get:r[o],enumerable:!0})},h=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of j(r))!tt.call(t,i)&&i!==o&&p(t,i,{get:()=>r[i],enumerable:!(n=K(r,i))||n.enumerable});return t},d=(t,r,o)=>(h(t,r,"default"),o&&h(o,r,"default")),x=(t,r,o)=>(o=t!=null?Z(q(t)):{},h(r||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>h(p({},"__esModule",{value:!0}),t);var mt={};k(mt,{detectFormat:()=>T,parse:()=>gt,stringify:()=>R});module.exports=rt(mt);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var a=require("@lskjs/err");var c={};k(c,{default:()=>w.default,stringify:()=>y.default});d(c,require("fast-safe-stringify"));var y=x(require("fast-safe-stringify")),w=x(require("fast-safe-stringify"));var l=e((t,r=null,o=0)=>typeof t=="object"?(0,y.default)(t,r,o):String(t),"toString");var S=e(t=>t.map(r=>(0,a.isError)(r)?(0,a.getCode)(r):null).filter(Boolean)[0],"getErrCode"),_=e(t=>t.length?t.map(r=>(0,a.isError)(r)?(0,a.getMessage)(r):l(r)).join(" "):null,"createMsg");var lt=require("@lskjs/algos");var et=require("@lskjs/algos"),L=require("@lskjs/env");var B=require("@lskjs/env");var f=e((t,r)=>{let o=[];return t!==null&&o.push((0,B.tryJSONparse)(t)),Object.keys(r).length&&o.push(r),o},"parseArgs");var E=["trace","debug","info","warn","error","fatal"];var C=e(t=>!!(E.includes(t.level)&&t.ns),"isLsklog"),F=e(t=>!!E.includes(t.level),"isLskLikelog"),g=e(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb");var v=e(t=>{let{level:r,time:o,msg:n,ns:i,name:u,...b}=t,m={level:r,time:o,msg:n,ns:i,name:u};if(!g(t))return{format:s.lsklogweb,meta:m,args:f(n,b)};let{reqId:z,method:D,host:G,ua:U,ip:V,url:J,status:Y,length:H,duration:Q,...X}=b;return{format:s.lsklog,meta:{...m,method:D,host:G,reqId:z,ua:U,ip:V,url:J,status:Y,duration:Q,length:H},args:f(n,X)}},"parseLsklog"),W=e(t=>{let{level:r,time:o,...n}=t;return l({level:r,time:+o,...n})},"stringifyLsklog");var nt=require("@lskjs/colors"),M=require("@lskjs/env"),st=x(require("pretty-bytes")),it=x(require("pretty-time"));var ot=require("@lskjs/colors");var er=(0,M.getEnvVar)("LOG_VIEW","short");var at={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"},ft={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60},A=e(t=>!!(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),I=e(t=>{let{level:r,time:o,msg:n,hostname:i,pid:u,v:b,...m}=t;return{format:s.bunyan,meta:{level:at[r],time:new Date(o)},args:f(n,m)}},"parseBunyan"),P=e(t=>{let{level:r,time:o,...n}=t;return l({level:ft[r],time:o.toISOString(),...n})},"stringifyBunyan");var ut=["trace","debug","info","warning","error","fatal","panic"],ct={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},pt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},N=e(t=>!!(t.msg&&ut.includes(t.level)),"isLogrus"),O=e(t=>{let{level:r,time:o,msg:n,...i}=t;return{format:s.logrus,meta:{level:ct[r],time:new Date(o)},args:f(n,i)}},"parseLogrus"),$=e(t=>{let{level:r,time:o,...n}=t;return l({level:pt[r],time:o.toISOString(),...n})},"stringifyLogrus");function T(t){return A(t)?s.bunyan:C(t)?s.lsklog:g(t)?s.lsklogweb:N(t)?s.logrus:F(t)?s.lsklog:null}e(T,"detectFormat");function R(t,r,...o){let n=S(o),i=_(o),u={code:n,...r,msg:i};return t==="bunyan"?P(u):t==="logrus"?$(u):W(u)}e(R,"stringify");function gt(t){let r=T(t);return r==="bunyan"?I(t):r==="lsklogweb"?v(t):r==="lsklog"?v(t):r==="logrus"?O(t):{format:r,meta:{},args:[t]}}e(gt,"parse");0&&(module.exports={detectFormat,parse,stringify});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var B=Object.create;var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var x=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of C(r))!W.call(t,n)&&n!==e&&a(t,n,{get:()=>r[n],enumerable:!(i=E(r,n))||i.enumerable});return t},c=(t,r,e)=>(u(t,r,"default"),e&&u(e,r,"default")),p=(t,r,e)=>(e=t!=null?B(F(t)):{},u(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),M=t=>u(a({},"__esModule",{value:!0}),t);var z={};x(z,{isLogrus:()=>v,logrusLevels:()=>_,parseLogrus:()=>k,stringifyLogrus:()=>w});module.exports=M(z);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var P=require("@lskjs/algos");var R=require("@lskjs/algos"),h=require("@lskjs/env");var d=require("@lskjs/err");var l={};x(l,{default:()=>y.default,stringify:()=>g.default});c(l,require("fast-safe-stringify"));var g=p(require("fast-safe-stringify")),y=p(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,g.default)(t,r,e):String(t),"toString");var b=require("@lskjs/env");var m=o((t,r)=>{let e=[];return t!==null&&e.push((0,b.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var I=require("@lskjs/colors"),S=require("@lskjs/env"),N=p(require("pretty-bytes")),O=p(require("pretty-time"));var A=require("@lskjs/colors");var Xt=(0,S.getEnvVar)("LOG_VIEW","short");var _=["trace","debug","info","warning","error","fatal","panic"],$={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},T={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},v=o(t=>Boolean(t.msg&&_.includes(t.level)),"isLogrus"),k=o(t=>{let{level:r,time:e,msg:i,...n}=t;return{format:s.logrus,meta:{level:$[r],time:new Date(e)},args:m(i,n)}},"parseLogrus"),w=o(t=>{let{level:r,time:e,...i}=t;return f({level:T[r],time:e.toISOString(),...i})},"stringifyLogrus");0&&(module.exports={isLogrus,logrusLevels,parseLogrus,stringifyLogrus});
"use strict";var B=Object.create;var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var x=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of C(r))!W.call(t,n)&&n!==e&&a(t,n,{get:()=>r[n],enumerable:!(i=E(r,n))||i.enumerable});return t},c=(t,r,e)=>(u(t,r,"default"),e&&u(e,r,"default")),p=(t,r,e)=>(e=t!=null?B(F(t)):{},u(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),M=t=>u(a({},"__esModule",{value:!0}),t);var z={};x(z,{isLogrus:()=>v,logrusLevels:()=>_,parseLogrus:()=>k,stringifyLogrus:()=>w});module.exports=M(z);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var O=require("@lskjs/algos");var R=require("@lskjs/algos"),h=require("@lskjs/env");var d=require("@lskjs/err");var l={};x(l,{default:()=>y.default,stringify:()=>g.default});c(l,require("fast-safe-stringify"));var g=p(require("fast-safe-stringify")),y=p(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,g.default)(t,r,e):String(t),"toString");var b=require("@lskjs/env");var m=o((t,r)=>{let e=[];return t!==null&&e.push((0,b.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var I=require("@lskjs/colors"),S=require("@lskjs/env"),P=p(require("pretty-bytes")),N=p(require("pretty-time"));var A=require("@lskjs/colors");var Xt=(0,S.getEnvVar)("LOG_VIEW","short");var _=["trace","debug","info","warning","error","fatal","panic"],$={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"},T={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"},v=o(t=>!!(t.msg&&_.includes(t.level)),"isLogrus"),k=o(t=>{let{level:r,time:e,msg:i,...n}=t;return{format:s.logrus,meta:{level:$[r],time:new Date(e)},args:m(i,n)}},"parseLogrus"),w=o(t=>{let{level:r,time:e,...i}=t;return f({level:T[r],time:e.toISOString(),...i})},"stringifyLogrus");0&&(module.exports={isLogrus,logrusLevels,parseLogrus,stringifyLogrus});
//# sourceMappingURL=logrus.js.map

@@ -1,2 +0,2 @@

"use strict";var D=Object.create;var f=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var e=(t,r)=>f(t,"name",{value:r,configurable:!0});var v=(t,r)=>{for(var o in r)f(t,o,{get:r[o],enumerable:!0})},p=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of U(r))!J.call(t,i)&&i!==o&&f(t,i,{get:()=>r[i],enumerable:!(n=G(r,i))||n.enumerable});return t},g=(t,r,o)=>(p(t,r,"default"),o&&p(o,r,"default")),m=(t,r,o)=>(o=t!=null?D(V(t)):{},p(r||!t||!t.__esModule?f(o,"default",{value:t,enumerable:!0}):o,t)),Y=t=>p(f({},"__esModule",{value:!0}),t);var tt={};v(tt,{isLskLikelog:()=>_,isLsklog:()=>S,isLsklogWeb:()=>a,isLsklogWebFinal:()=>F,lsklogLevels:()=>y,lsklogWebLevels:()=>q,parseLsklog:()=>B,stringifyLsklog:()=>E});module.exports=Y(tt);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var j=require("@lskjs/algos");var H=require("@lskjs/algos"),d=require("@lskjs/env");var x=require("@lskjs/err");var l={};v(l,{default:()=>k.default,stringify:()=>h.default});g(l,require("fast-safe-stringify"));var h=m(require("fast-safe-stringify")),k=m(require("fast-safe-stringify"));var u=e((t,r=null,o=0)=>typeof t=="object"?(0,h.default)(t,r,o):String(t),"toString");var w=require("@lskjs/env");var c=e((t,r)=>{let o=[];return t!==null&&o.push((0,w.tryJSONparse)(t)),Object.keys(r).length&&o.push(r),o},"parseArgs");var X=require("@lskjs/colors"),C=require("@lskjs/env"),Z=m(require("pretty-bytes")),K=m(require("pretty-time"));var Q=require("@lskjs/colors");var lr=(0,C.getEnvVar)("LOG_VIEW","short");var y=["trace","debug","info","warn","error","fatal"],q=["reqId","method","host","ua","ip","url","status","length","duration"],S=e(t=>Boolean(y.includes(t.level)&&t.ns),"isLsklog"),_=e(t=>Boolean(y.includes(t.level)),"isLskLikelog"),a=e(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),F=e(t=>Boolean(a(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),B=e(t=>{let{level:r,time:o,msg:n,ns:i,name:W,...b}=t,L={level:r,time:o,msg:n,ns:i,name:W};if(!a(t))return{format:s.lsklogweb,meta:L,args:c(n,b)};let{reqId:M,method:R,host:A,ua:I,ip:N,url:O,status:P,length:$,duration:T,...z}=b;return{format:s.lsklog,meta:{...L,method:R,host:A,reqId:M,ua:I,ip:N,url:O,status:P,duration:T,length:$},args:c(n,z)}},"parseLsklog"),E=e(t=>{let{level:r,time:o,...n}=t;return u({level:r,time:+o,...n})},"stringifyLsklog");0&&(module.exports={isLskLikelog,isLsklog,isLsklogWeb,isLsklogWebFinal,lsklogLevels,lsklogWebLevels,parseLsklog,stringifyLsklog});
"use strict";var D=Object.create;var f=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var e=(t,r)=>f(t,"name",{value:r,configurable:!0});var v=(t,r)=>{for(var o in r)f(t,o,{get:r[o],enumerable:!0})},p=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of U(r))!J.call(t,i)&&i!==o&&f(t,i,{get:()=>r[i],enumerable:!(n=G(r,i))||n.enumerable});return t},g=(t,r,o)=>(p(t,r,"default"),o&&p(o,r,"default")),m=(t,r,o)=>(o=t!=null?D(V(t)):{},p(r||!t||!t.__esModule?f(o,"default",{value:t,enumerable:!0}):o,t)),Y=t=>p(f({},"__esModule",{value:!0}),t);var tt={};v(tt,{isLskLikelog:()=>_,isLsklog:()=>S,isLsklogWeb:()=>a,isLsklogWebFinal:()=>F,lsklogLevels:()=>y,lsklogWebLevels:()=>q,parseLsklog:()=>B,stringifyLsklog:()=>E});module.exports=Y(tt);var s;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(s||(s={}));var j=require("@lskjs/algos");var H=require("@lskjs/algos"),d=require("@lskjs/env");var x=require("@lskjs/err");var l={};v(l,{default:()=>k.default,stringify:()=>h.default});g(l,require("fast-safe-stringify"));var h=m(require("fast-safe-stringify")),k=m(require("fast-safe-stringify"));var u=e((t,r=null,o=0)=>typeof t=="object"?(0,h.default)(t,r,o):String(t),"toString");var w=require("@lskjs/env");var c=e((t,r)=>{let o=[];return t!==null&&o.push((0,w.tryJSONparse)(t)),Object.keys(r).length&&o.push(r),o},"parseArgs");var X=require("@lskjs/colors"),C=require("@lskjs/env"),Z=m(require("pretty-bytes")),K=m(require("pretty-time"));var Q=require("@lskjs/colors");var lr=(0,C.getEnvVar)("LOG_VIEW","short");var y=["trace","debug","info","warn","error","fatal"],q=["reqId","method","host","ua","ip","url","status","length","duration"],S=e(t=>!!(y.includes(t.level)&&t.ns),"isLsklog"),_=e(t=>!!y.includes(t.level),"isLskLikelog"),a=e(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),F=e(t=>!!(a(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),B=e(t=>{let{level:r,time:o,msg:n,ns:i,name:W,...b}=t,L={level:r,time:o,msg:n,ns:i,name:W};if(!a(t))return{format:s.lsklogweb,meta:L,args:c(n,b)};let{reqId:M,method:R,host:A,ua:I,ip:P,url:N,status:O,length:$,duration:T,...z}=b;return{format:s.lsklog,meta:{...L,method:R,host:A,reqId:M,ua:I,ip:P,url:N,status:O,duration:T,length:$},args:c(n,z)}},"parseLsklog"),E=e(t=>{let{level:r,time:o,...n}=t;return u({level:r,time:+o,...n})},"stringifyLsklog");0&&(module.exports={isLskLikelog,isLsklog,isLsklogWeb,isLsklogWebFinal,lsklogLevels,lsklogWebLevels,parseLsklog,stringifyLsklog});
//# sourceMappingURL=lsklog.js.map

@@ -1,2 +0,2 @@

"use strict";var wt=Object.create;var g=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var o=(t,r)=>g(t,"name",{value:r,configurable:!0});var N=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of _t(r))!Et.call(t,s)&&s!==e&&g(t,s,{get:()=>r[s],enumerable:!(n=St(r,s))||n.enumerable});return t},x=(t,r,e)=>(y(t,r,"default"),e&&y(e,r,"default")),b=(t,r,e)=>(e=t!=null?wt(Bt(t)):{},y(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),Ct=t=>y(g({},"__esModule",{value:!0}),t);var zt={};N(zt,{concatFirstStrings:()=>ft,countInRow:()=>at,getStatusLevel:()=>M,getUrlLevel:()=>lt,prettyContent:()=>I,prettyFormat:()=>m,prettyLevel:()=>L,prettyMarker:()=>it,prettyMethod:()=>ot,prettyNs:()=>A,prettyPath:()=>tt,prettyRawLog:()=>Tt,prettyReqId:()=>et,prettySize:()=>st,prettyStatus:()=>rt,prettyTime:()=>nt,prettyUrl:()=>P});module.exports=Ct(zt);var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var At=require("@lskjs/algos");var $={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},v=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],k=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var Ft=require("@lskjs/algos"),w=require("@lskjs/env");var B=require("@lskjs/err");var p={};N(p,{default:()=>T.default,stringify:()=>S.default});x(p,require("fast-safe-stringify"));var S=b(require("fast-safe-stringify")),T=b(require("fast-safe-stringify"));var z=require("@lskjs/env");var u=o((t,r)=>{let e=[];return t!==null&&e.push((0,z.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var Ot={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"};var D=o(t=>Boolean(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),G=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:l,v:a,...f}=t;return{format:i.bunyan,meta:{level:Ot[r],time:new Date(e)},args:u(n,f)}},"parseBunyan");var Rt=["trace","debug","info","warning","error","fatal","panic"],Wt={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"};var U=o(t=>Boolean(t.msg&&Rt.includes(t.level)),"isLogrus"),V=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:i.logrus,meta:{level:Wt[r],time:new Date(e)},args:u(n,s)}},"parseLogrus");function Mt(t){return D(t)?i.bunyan:Y(t)?i.lsklog:c(t)?i.lsklogweb:U(t)?i.logrus:H(t)?i.lsklog:null}o(Mt,"detectFormat");function J(t){let r=Mt(t);return r==="bunyan"?G(t):r==="lsklogweb"?E(t):r==="lsklog"?E(t):r==="logrus"?V(t):{format:r,meta:{},args:[t]}}o(J,"parse");var Q=["trace","debug","info","warn","error","fatal"];var Y=o(t=>Boolean(Q.includes(t.level)&&t.ns),"isLsklog"),H=o(t=>Boolean(Q.includes(t.level)),"isLskLikelog"),c=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>Boolean(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),E=o(t=>{let{level:r,time:e,msg:n,ns:s,name:l,...a}=t,f={level:r,time:e,msg:n,ns:s,name:l};if(!c(t))return{format:i.lsklogweb,meta:f,args:u(n,a)};let{reqId:mt,method:gt,host:ht,ua:dt,ip:yt,url:xt,status:bt,length:Lt,duration:vt,...kt}=a;return{format:i.lsklog,meta:{...f,method:gt,host:ht,reqId:mt,ua:dt,ip:yt,url:xt,status:bt,duration:vt,length:Lt},args:u(n,kt)}},"parseLsklog");var Z=require("@lskjs/colors"),K=require("@lskjs/env"),j=b(require("pretty-bytes")),q=b(require("pretty-time"));var O=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),X=F;function R(t,r){let e=v[X(r||"")%v.length]||[];return(0,O.colorize)(t,e)}o(R,"themeizeRandom");function h(t,r){let e=r?$[r]:[];return(0,O.colorize)(t,e)}o(h,"themeize");var It=(0,K.getEnvVar)("LOG_VIEW","short"),d=o((t,r)=>String(t).padStart(r),"leftPad"),Pt=o((t,r)=>String(t).padEnd(r),"rightPad"),W=20,tt=o((t,r=0)=>(W=Math.max(t&&t.length||0,W,r),Pt(t,W)),"prettyPath"),M=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),rt=o(t=>{let r=M(t);return r||(r=t!==200?"log":null),h(d(String(t),3),r)},"prettyStatus"),et=o(t=>d(`#${t}`,3),"prettyReqId"),ot=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return h(d(t,4),r)},"prettyMethod"),nt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",l=Math.floor(Math.abs(t)*10**6),a=(0,q.default)(l,s);return h(d(a,5),e)},"prettyTime"),st=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,j.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),A=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>R(n,n)).join(":"),"prettyNs");function it(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return R(e,String(t))}o(it,"prettyMarker");var L=o(t=>{let r=It==="short"?(t[0]||"").toLowerCase():d(t,5);return r=`[${r}]`,h(r,t)},"prettyLevel"),Nt=/\[[^"\]]+]/gm,I=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(Nt,s=>(0,Z.colorize)(s,k[n++%k.length])))}else r.push(e)}),r},"prettyContent"),lt=o(t=>M(t.status)||C(t)?"debug":"trace","getUrlLevel"),P=o(t=>{let r=C(t),e=lt(t);return[L(e),[it(t.reqId),ot(t.method)].join(""),tt(t.url),et(t.reqId),r&&t.method!=="WS"?rt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&nt(t.duration),r&&t.method!=="WS"?st(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function at(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(at,"countInRow");function ft(...t){let r=at(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(ft,"concatFirstStrings");function m(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",l=r;if(c(t))return[P(t)];let a=(e||"").split(":").filter(Boolean).map(String),f=[L(s)];return(a.length||n)&&f.push(A(a,n)),ft(...f,...I(...l))}o(m,"prettyFormat");var pt=require("@lskjs/env");var ut=require("@lskjs/algos");var $t=require("logfmt"),ct=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=$t.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,ut.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var Tt=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,pt.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=ct(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...m({},r));return}if(typeof e!="object"){t.log(...m({},e));return}let{meta:s,args:l=[]}=J(e);t.log(...m(s,...l))},"prettyRawLog");0&&(module.exports={concatFirstStrings,countInRow,getStatusLevel,getUrlLevel,prettyContent,prettyFormat,prettyLevel,prettyMarker,prettyMethod,prettyNs,prettyPath,prettyRawLog,prettyReqId,prettySize,prettyStatus,prettyTime,prettyUrl});
"use strict";var wt=Object.create;var g=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var o=(t,r)=>g(t,"name",{value:r,configurable:!0});var N=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of _t(r))!Et.call(t,s)&&s!==e&&g(t,s,{get:()=>r[s],enumerable:!(n=St(r,s))||n.enumerable});return t},x=(t,r,e)=>(y(t,r,"default"),e&&y(e,r,"default")),b=(t,r,e)=>(e=t!=null?wt(Bt(t)):{},y(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),Ct=t=>y(g({},"__esModule",{value:!0}),t);var zt={};N(zt,{concatFirstStrings:()=>ft,countInRow:()=>at,getStatusLevel:()=>M,getUrlLevel:()=>lt,prettyContent:()=>A,prettyFormat:()=>m,prettyLevel:()=>L,prettyMarker:()=>it,prettyMethod:()=>ot,prettyNs:()=>P,prettyPath:()=>tt,prettyRawLog:()=>Tt,prettyReqId:()=>et,prettySize:()=>st,prettyStatus:()=>rt,prettyTime:()=>nt,prettyUrl:()=>I});module.exports=Ct(zt);var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var Pt=require("@lskjs/algos");var $={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},v=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],k=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var Ft=require("@lskjs/algos"),w=require("@lskjs/env");var B=require("@lskjs/err");var p={};N(p,{default:()=>T.default,stringify:()=>S.default});x(p,require("fast-safe-stringify"));var S=b(require("fast-safe-stringify")),T=b(require("fast-safe-stringify"));var z=require("@lskjs/env");var u=o((t,r)=>{let e=[];return t!==null&&e.push((0,z.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var Ot={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"};var D=o(t=>!!(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),G=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:l,v:a,...f}=t;return{format:i.bunyan,meta:{level:Ot[r],time:new Date(e)},args:u(n,f)}},"parseBunyan");var Rt=["trace","debug","info","warning","error","fatal","panic"],Wt={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"};var U=o(t=>!!(t.msg&&Rt.includes(t.level)),"isLogrus"),V=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:i.logrus,meta:{level:Wt[r],time:new Date(e)},args:u(n,s)}},"parseLogrus");function Mt(t){return D(t)?i.bunyan:Y(t)?i.lsklog:c(t)?i.lsklogweb:U(t)?i.logrus:H(t)?i.lsklog:null}o(Mt,"detectFormat");function J(t){let r=Mt(t);return r==="bunyan"?G(t):r==="lsklogweb"?E(t):r==="lsklog"?E(t):r==="logrus"?V(t):{format:r,meta:{},args:[t]}}o(J,"parse");var Q=["trace","debug","info","warn","error","fatal"];var Y=o(t=>!!(Q.includes(t.level)&&t.ns),"isLsklog"),H=o(t=>!!Q.includes(t.level),"isLskLikelog"),c=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>!!(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),E=o(t=>{let{level:r,time:e,msg:n,ns:s,name:l,...a}=t,f={level:r,time:e,msg:n,ns:s,name:l};if(!c(t))return{format:i.lsklogweb,meta:f,args:u(n,a)};let{reqId:mt,method:gt,host:ht,ua:dt,ip:yt,url:xt,status:bt,length:Lt,duration:vt,...kt}=a;return{format:i.lsklog,meta:{...f,method:gt,host:ht,reqId:mt,ua:dt,ip:yt,url:xt,status:bt,duration:vt,length:Lt},args:u(n,kt)}},"parseLsklog");var Z=require("@lskjs/colors"),K=require("@lskjs/env"),j=b(require("pretty-bytes")),q=b(require("pretty-time"));var O=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),X=F;function R(t,r){let e=v[X(r||"")%v.length]||[];return(0,O.colorize)(t,e)}o(R,"themeizeRandom");function h(t,r){let e=r?$[r]:[];return(0,O.colorize)(t,e)}o(h,"themeize");var At=(0,K.getEnvVar)("LOG_VIEW","short"),d=o((t,r)=>String(t).padStart(r),"leftPad"),It=o((t,r)=>String(t).padEnd(r),"rightPad"),W=20,tt=o((t,r=0)=>(W=Math.max(t&&t.length||0,W,r),It(t,W)),"prettyPath"),M=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),rt=o(t=>{let r=M(t);return r||(r=t!==200?"log":null),h(d(String(t),3),r)},"prettyStatus"),et=o(t=>d(`#${t}`,3),"prettyReqId"),ot=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return h(d(t,4),r)},"prettyMethod"),nt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",l=Math.floor(Math.abs(t)*10**6),a=(0,q.default)(l,s);return h(d(a,5),e)},"prettyTime"),st=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,j.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),P=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>R(n,n)).join(":"),"prettyNs");function it(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return R(e,String(t))}o(it,"prettyMarker");var L=o(t=>{let r=At==="short"?(t[0]||"").toLowerCase():d(t,5);return r=`[${r}]`,h(r,t)},"prettyLevel"),Nt=/\[[^"\]]+]/gm,A=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(Nt,s=>(0,Z.colorize)(s,k[n++%k.length])))}else r.push(e)}),r},"prettyContent"),lt=o(t=>M(t.status)||C(t)?"debug":"trace","getUrlLevel"),I=o(t=>{let r=C(t),e=lt(t);return[L(e),[it(t.reqId),ot(t.method)].join(""),tt(t.url),et(t.reqId),r&&t.method!=="WS"?rt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&nt(t.duration),r&&t.method!=="WS"?st(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function at(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(at,"countInRow");function ft(...t){let r=at(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(ft,"concatFirstStrings");function m(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",l=r;if(c(t))return[I(t)];let a=(e||"").split(":").filter(Boolean).map(String),f=[L(s)];return(a.length||n)&&f.push(P(a,n)),ft(...f,...A(...l))}o(m,"prettyFormat");var pt=require("@lskjs/env");var ut=require("@lskjs/algos");var $t=require("logfmt"),ct=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=$t.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,ut.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var Tt=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,pt.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=ct(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...m({},r));return}if(typeof e!="object"){t.log(...m({},e));return}let{meta:s,args:l=[]}=J(e);t.log(...m(s,...l))},"prettyRawLog");0&&(module.exports={concatFirstStrings,countInRow,getStatusLevel,getUrlLevel,prettyContent,prettyFormat,prettyLevel,prettyMarker,prettyMethod,prettyNs,prettyPath,prettyRawLog,prettyReqId,prettySize,prettyStatus,prettyTime,prettyUrl});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var Y=Object.create;var a=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var M=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},g=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Q(r))!Z.call(t,s)&&s!==e&&a(t,s,{get:()=>r[s],enumerable:!(n=H(r,s))||n.enumerable});return t},m=(t,r,e)=>(g(t,r,"default"),e&&g(e,r,"default")),h=(t,r,e)=>(e=t!=null?Y(X(t)):{},g(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),K=t=>g(a({},"__esModule",{value:!0}),t);var gt={};M(gt,{concatFirstStrings:()=>J,countInRow:()=>V,default:()=>pt,prettyFormat:()=>w});module.exports=K(gt);var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var tt=require("@lskjs/algos");var R={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},x=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],y=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var j=require("@lskjs/algos"),b=require("@lskjs/env");var k=require("@lskjs/err");var l={};M(l,{default:()=>A.default,stringify:()=>L.default});m(l,require("fast-safe-stringify"));var L=h(require("fast-safe-stringify")),A=h(require("fast-safe-stringify"));var q=require("@lskjs/env");var f=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),S=o(t=>Boolean(f(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var O=require("@lskjs/colors"),P=require("@lskjs/env"),$=h(require("pretty-bytes")),T=h(require("pretty-time"));var B=require("@lskjs/colors");var _=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),N=_;function E(t,r){let e=x[N(r||"")%x.length]||[];return(0,B.colorize)(t,e)}o(E,"themeizeRandom");function u(t,r){let e=r?R[r]:[];return(0,B.colorize)(t,e)}o(u,"themeize");var rt=(0,P.getEnvVar)("LOG_VIEW","short"),c=o((t,r)=>String(t).padStart(r),"leftPad"),et=o((t,r)=>String(t).padEnd(r),"rightPad"),C=20,ot=o((t,r=0)=>(C=Math.max(t&&t.length||0,C,r),et(t,C)),"prettyPath"),z=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),nt=o(t=>{let r=z(t);return r||(r=t!==200?"log":null),u(c(String(t),3),r)},"prettyStatus"),st=o(t=>c(`#${t}`,3),"prettyReqId"),it=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return u(c(t,4),r)},"prettyMethod"),lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",d=Math.floor(Math.abs(t)*10**6),p=(0,T.default)(d,s);return u(c(p,5),e)},"prettyTime"),at=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,$.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),D=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>E(n,n)).join(":"),"prettyNs");function ft(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[_(t)%r.length];return E(e,String(t))}o(ft,"prettyMarker");var F=o(t=>{let r=rt==="short"?(t[0]||"").toLowerCase():c(t,5);return r=`[${r}]`,u(r,t)},"prettyLevel"),ut=/\[[^"\]]+]/gm,G=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(ut,s=>(0,O.colorize)(s,y[n++%y.length])))}else r.push(e)}),r},"prettyContent"),ct=o(t=>z(t.status)||S(t)?"debug":"trace","getUrlLevel"),U=o(t=>{let r=S(t),e=ct(t);return[F(e),[ft(t.reqId),it(t.method)].join(""),ot(t.url),st(t.reqId),r&&t.method!=="WS"?nt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&lt(t.duration),r&&t.method!=="WS"?at(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function V(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(V,"countInRow");function J(...t){let r=V(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(J,"concatFirstStrings");function w(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",d=r;if(f(t))return[U(t)];let p=(e||"").split(":").filter(Boolean).map(String),W=[F(s)];return(p.length||n)&&W.push(D(p,n)),J(...W,...G(...d))}o(w,"prettyFormat");var pt=w;0&&(module.exports={concatFirstStrings,countInRow,prettyFormat});
"use strict";var Y=Object.create;var a=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});var M=(t,r)=>{for(var e in r)a(t,e,{get:r[e],enumerable:!0})},g=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Q(r))!Z.call(t,s)&&s!==e&&a(t,s,{get:()=>r[s],enumerable:!(n=H(r,s))||n.enumerable});return t},m=(t,r,e)=>(g(t,r,"default"),e&&g(e,r,"default")),h=(t,r,e)=>(e=t!=null?Y(X(t)):{},g(r||!t||!t.__esModule?a(e,"default",{value:t,enumerable:!0}):e,t)),K=t=>g(a({},"__esModule",{value:!0}),t);var gt={};M(gt,{concatFirstStrings:()=>J,countInRow:()=>V,default:()=>pt,prettyFormat:()=>w});module.exports=K(gt);var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var tt=require("@lskjs/algos");var R={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},x=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],y=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var j=require("@lskjs/algos"),b=require("@lskjs/env");var k=require("@lskjs/err");var l={};M(l,{default:()=>A.default,stringify:()=>L.default});m(l,require("fast-safe-stringify"));var L=h(require("fast-safe-stringify")),A=h(require("fast-safe-stringify"));var q=require("@lskjs/env");var f=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),S=o(t=>!!(f(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var N=require("@lskjs/colors"),O=require("@lskjs/env"),$=h(require("pretty-bytes")),T=h(require("pretty-time"));var B=require("@lskjs/colors");var _=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),P=_;function E(t,r){let e=x[P(r||"")%x.length]||[];return(0,B.colorize)(t,e)}o(E,"themeizeRandom");function u(t,r){let e=r?R[r]:[];return(0,B.colorize)(t,e)}o(u,"themeize");var rt=(0,O.getEnvVar)("LOG_VIEW","short"),c=o((t,r)=>String(t).padStart(r),"leftPad"),et=o((t,r)=>String(t).padEnd(r),"rightPad"),C=20,ot=o((t,r=0)=>(C=Math.max(t&&t.length||0,C,r),et(t,C)),"prettyPath"),z=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),nt=o(t=>{let r=z(t);return r||(r=t!==200?"log":null),u(c(String(t),3),r)},"prettyStatus"),st=o(t=>c(`#${t}`,3),"prettyReqId"),it=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return u(c(t,4),r)},"prettyMethod"),lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",d=Math.floor(Math.abs(t)*10**6),p=(0,T.default)(d,s);return u(c(p,5),e)},"prettyTime"),at=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,$.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),D=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>E(n,n)).join(":"),"prettyNs");function ft(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[_(t)%r.length];return E(e,String(t))}o(ft,"prettyMarker");var F=o(t=>{let r=rt==="short"?(t[0]||"").toLowerCase():c(t,5);return r=`[${r}]`,u(r,t)},"prettyLevel"),ut=/\[[^"\]]+]/gm,G=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(ut,s=>(0,N.colorize)(s,y[n++%y.length])))}else r.push(e)}),r},"prettyContent"),ct=o(t=>z(t.status)||S(t)?"debug":"trace","getUrlLevel"),U=o(t=>{let r=S(t),e=ct(t);return[F(e),[ft(t.reqId),it(t.method)].join(""),ot(t.url),st(t.reqId),r&&t.method!=="WS"?nt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&lt(t.duration),r&&t.method!=="WS"?at(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function V(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(V,"countInRow");function J(...t){let r=V(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(J,"concatFirstStrings");function w(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",d=r;if(f(t))return[U(t)];let p=(e||"").split(":").filter(Boolean).map(String),W=[F(s)];return(p.length||n)&&W.push(D(p,n)),J(...W,...G(...d))}o(w,"prettyFormat");var pt=w;0&&(module.exports={concatFirstStrings,countInRow,prettyFormat});
//# sourceMappingURL=prettyFormat.js.map

@@ -1,2 +0,2 @@

"use strict";var gt=Object.create;var m=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var o=(t,r)=>m(t,"name",{value:r,configurable:!0});var M=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of dt(r))!xt.call(t,s)&&s!==e&&m(t,s,{get:()=>r[s],enumerable:!(n=ht(r,s))||n.enumerable});return t},x=(t,r,e)=>(y(t,r,"default"),e&&y(e,r,"default")),b=(t,r,e)=>(e=t!=null?gt(yt(t)):{},y(r||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),bt=t=>y(m({},"__esModule",{value:!0}),t);var Dt={};M(Dt,{default:()=>zt,prettyRawLog:()=>ot});module.exports=bt(Dt);var et=require("@lskjs/env");var A=require("@lskjs/algos");var Lt=require("logfmt"),I=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=Lt.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,A.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var k=require("@lskjs/err");var p={};M(p,{default:()=>P.default,stringify:()=>L.default});x(p,require("fast-safe-stringify"));var L=b(require("fast-safe-stringify")),P=b(require("fast-safe-stringify"));var It=require("@lskjs/algos");var N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},w=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],S=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var vt=require("@lskjs/algos"),_=require("@lskjs/env");var $=require("@lskjs/env");var u=o((t,r)=>{let e=[];return t!==null&&e.push((0,$.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var T=["trace","debug","info","warn","error","fatal"];var z=o(t=>Boolean(T.includes(t.level)&&t.ns),"isLsklog"),D=o(t=>Boolean(T.includes(t.level)),"isLskLikelog"),c=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),B=o(t=>Boolean(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),E=o(t=>{let{level:r,time:e,msg:n,ns:s,name:l,...a}=t,f={level:r,time:e,msg:n,ns:s,name:l};if(!c(t))return{format:i.lsklogweb,meta:f,args:u(n,a)};let{reqId:nt,method:st,host:it,ua:lt,ip:at,url:ft,status:ut,length:ct,duration:pt,...mt}=a;return{format:i.lsklog,meta:{...f,method:st,host:it,reqId:nt,ua:lt,ip:at,url:ft,status:ut,duration:pt,length:ct},args:u(n,mt)}},"parseLsklog");var U=require("@lskjs/colors"),V=require("@lskjs/env"),J=b(require("pretty-bytes")),Y=b(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),G=C;function O(t,r){let e=w[G(r||"")%w.length]||[];return(0,F.colorize)(t,e)}o(O,"themeizeRandom");function g(t,r){let e=r?N[r]:[];return(0,F.colorize)(t,e)}o(g,"themeize");var kt=(0,V.getEnvVar)("LOG_VIEW","short"),h=o((t,r)=>String(t).padStart(r),"leftPad"),wt=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,St=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),wt(t,R)),"prettyPath"),H=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),_t=o(t=>{let r=H(t);return r||(r=t!==200?"log":null),g(h(String(t),3),r)},"prettyStatus"),Bt=o(t=>h(`#${t}`,3),"prettyReqId"),Et=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return g(h(t,4),r)},"prettyMethod"),Ct=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",l=Math.floor(Math.abs(t)*10**6),a=(0,Y.default)(l,s);return g(h(a,5),e)},"prettyTime"),Ft=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,J.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),Q=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>O(n,n)).join(":"),"prettyNs");function Ot(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return O(e,String(t))}o(Ot,"prettyMarker");var W=o(t=>{let r=kt==="short"?(t[0]||"").toLowerCase():h(t,5);return r=`[${r}]`,g(r,t)},"prettyLevel"),Rt=/\[[^"\]]+]/gm,X=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(Rt,s=>(0,U.colorize)(s,S[n++%S.length])))}else r.push(e)}),r},"prettyContent"),Wt=o(t=>H(t.status)||B(t)?"debug":"trace","getUrlLevel"),Z=o(t=>{let r=B(t),e=Wt(t);return[W(e),[Ot(t.reqId),Et(t.method)].join(""),St(t.url),Bt(t.reqId),r&&t.method!=="WS"?_t(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Ct(t.duration),r&&t.method!=="WS"?Ft(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function Mt(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(Mt,"countInRow");function At(...t){let r=Mt(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(At,"concatFirstStrings");function d(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",l=r;if(c(t))return[Z(t)];let a=(e||"").split(":").filter(Boolean).map(String),f=[W(s)];return(a.length||n)&&f.push(Q(a,n)),At(...f,...X(...l))}o(d,"prettyFormat");var Pt={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"};var K=o(t=>Boolean(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),j=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:l,v:a,...f}=t;return{format:i.bunyan,meta:{level:Pt[r],time:new Date(e)},args:u(n,f)}},"parseBunyan");var Nt=["trace","debug","info","warning","error","fatal","panic"],$t={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"};var q=o(t=>Boolean(t.msg&&Nt.includes(t.level)),"isLogrus"),tt=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:i.logrus,meta:{level:$t[r],time:new Date(e)},args:u(n,s)}},"parseLogrus");function Tt(t){return K(t)?i.bunyan:z(t)?i.lsklog:c(t)?i.lsklogweb:q(t)?i.logrus:D(t)?i.lsklog:null}o(Tt,"detectFormat");function rt(t){let r=Tt(t);return r==="bunyan"?j(t):r==="lsklogweb"?E(t):r==="lsklog"?E(t):r==="logrus"?tt(t):{format:r,meta:{},args:[t]}}o(rt,"parse");var ot=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,et.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=I(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...d({},r));return}if(typeof e!="object"){t.log(...d({},e));return}let{meta:s,args:l=[]}=rt(e);t.log(...d(s,...l))},"prettyRawLog"),zt=ot;0&&(module.exports={prettyRawLog});
"use strict";var gt=Object.create;var m=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var o=(t,r)=>m(t,"name",{value:r,configurable:!0});var M=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},y=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of dt(r))!xt.call(t,s)&&s!==e&&m(t,s,{get:()=>r[s],enumerable:!(n=ht(r,s))||n.enumerable});return t},x=(t,r,e)=>(y(t,r,"default"),e&&y(e,r,"default")),b=(t,r,e)=>(e=t!=null?gt(yt(t)):{},y(r||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),bt=t=>y(m({},"__esModule",{value:!0}),t);var Dt={};M(Dt,{default:()=>zt,prettyRawLog:()=>ot});module.exports=bt(Dt);var et=require("@lskjs/env");var P=require("@lskjs/algos");var Lt=require("logfmt"),A=o((t,r=t)=>{try{if(typeof t!="string")return t;if(!t.trim())return r;let e=Lt.parse(t);return Object.keys(e).includes("")||Object.keys(e).length<2||(0,P.count)(e,n=>n===!0)>=Object.keys(e).length/2?r:e}catch{return r}},"tryLogfmtParse");var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var k=require("@lskjs/err");var p={};M(p,{default:()=>I.default,stringify:()=>L.default});x(p,require("fast-safe-stringify"));var L=b(require("fast-safe-stringify")),I=b(require("fast-safe-stringify"));var At=require("@lskjs/algos");var N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},w=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],S=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var vt=require("@lskjs/algos"),_=require("@lskjs/env");var $=require("@lskjs/env");var u=o((t,r)=>{let e=[];return t!==null&&e.push((0,$.tryJSONparse)(t)),Object.keys(r).length&&e.push(r),e},"parseArgs");var T=["trace","debug","info","warn","error","fatal"];var z=o(t=>!!(T.includes(t.level)&&t.ns),"isLsklog"),D=o(t=>!!T.includes(t.level),"isLskLikelog"),c=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),B=o(t=>!!(c(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal"),E=o(t=>{let{level:r,time:e,msg:n,ns:s,name:l,...a}=t,f={level:r,time:e,msg:n,ns:s,name:l};if(!c(t))return{format:i.lsklogweb,meta:f,args:u(n,a)};let{reqId:nt,method:st,host:it,ua:lt,ip:at,url:ft,status:ut,length:ct,duration:pt,...mt}=a;return{format:i.lsklog,meta:{...f,method:st,host:it,reqId:nt,ua:lt,ip:at,url:ft,status:ut,duration:pt,length:ct},args:u(n,mt)}},"parseLsklog");var U=require("@lskjs/colors"),V=require("@lskjs/env"),J=b(require("pretty-bytes")),Y=b(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),G=C;function O(t,r){let e=w[G(r||"")%w.length]||[];return(0,F.colorize)(t,e)}o(O,"themeizeRandom");function g(t,r){let e=r?N[r]:[];return(0,F.colorize)(t,e)}o(g,"themeize");var kt=(0,V.getEnvVar)("LOG_VIEW","short"),h=o((t,r)=>String(t).padStart(r),"leftPad"),wt=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,St=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),wt(t,R)),"prettyPath"),H=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),_t=o(t=>{let r=H(t);return r||(r=t!==200?"log":null),g(h(String(t),3),r)},"prettyStatus"),Bt=o(t=>h(`#${t}`,3),"prettyReqId"),Et=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return g(h(t,4),r)},"prettyMethod"),Ct=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",l=Math.floor(Math.abs(t)*10**6),a=(0,Y.default)(l,s);return g(h(a,5),e)},"prettyTime"),Ft=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,J.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),Q=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>O(n,n)).join(":"),"prettyNs");function Ot(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return O(e,String(t))}o(Ot,"prettyMarker");var W=o(t=>{let r=kt==="short"?(t[0]||"").toLowerCase():h(t,5);return r=`[${r}]`,g(r,t)},"prettyLevel"),Rt=/\[[^"\]]+]/gm,X=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(Rt,s=>(0,U.colorize)(s,S[n++%S.length])))}else r.push(e)}),r},"prettyContent"),Wt=o(t=>H(t.status)||B(t)?"debug":"trace","getUrlLevel"),Z=o(t=>{let r=B(t),e=Wt(t);return[W(e),[Ot(t.reqId),Et(t.method)].join(""),St(t.url),Bt(t.reqId),r&&t.method!=="WS"?_t(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Ct(t.duration),r&&t.method!=="WS"?Ft(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function Mt(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(Mt,"countInRow");function Pt(...t){let r=Mt(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Pt,"concatFirstStrings");function d(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",l=r;if(c(t))return[Z(t)];let a=(e||"").split(":").filter(Boolean).map(String),f=[W(s)];return(a.length||n)&&f.push(Q(a,n)),Pt(...f,...X(...l))}o(d,"prettyFormat");var It={10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"};var K=o(t=>!!(t.name&&t.hostname&&t.pid&&t.msg&&t.time),"isBunyan"),j=o(t=>{let{level:r,time:e,msg:n,hostname:s,pid:l,v:a,...f}=t;return{format:i.bunyan,meta:{level:It[r],time:new Date(e)},args:u(n,f)}},"parseBunyan");var Nt=["trace","debug","info","warning","error","fatal","panic"],$t={trace:"trace",debug:"debug",info:"info",warning:"warn",error:"error",fatal:"fatal",panic:"fatal"};var q=o(t=>!!(t.msg&&Nt.includes(t.level)),"isLogrus"),tt=o(t=>{let{level:r,time:e,msg:n,...s}=t;return{format:i.logrus,meta:{level:$t[r],time:new Date(e)},args:u(n,s)}},"parseLogrus");function Tt(t){return K(t)?i.bunyan:z(t)?i.lsklog:c(t)?i.lsklogweb:q(t)?i.logrus:D(t)?i.lsklog:null}o(Tt,"detectFormat");function rt(t){let r=Tt(t);return r==="bunyan"?j(t):r==="lsklogweb"?E(t):r==="lsklog"?E(t):r==="logrus"?tt(t):{format:r,meta:{},args:[t]}}o(rt,"parse");var ot=o((t,r)=>{let e,n;if(typeof r=="string"&&(!e&&r.trim()&&(e=(0,et.tryJSONparse)(r,null),e!==null&&(n="json")),!e&&r.trim()&&(e=A(r,null),e!==null&&(n="logfmt"))),e===null&&(e=null,n="raw"),!e){t.log(...d({},r));return}if(typeof e!="object"){t.log(...d({},e));return}let{meta:s,args:l=[]}=rt(e);t.log(...d(s,...l))},"prettyRawLog"),zt=ot;0&&(module.exports={prettyRawLog});
//# sourceMappingURL=prettyRawLog.js.map

@@ -1,2 +0,2 @@

"use strict";var Z=Object.create;var a=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var e=(t,r)=>a(t,"name",{value:r,configurable:!0});var C=(t,r)=>{for(var o in r)a(t,o,{get:r[o],enumerable:!0})},c=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of j(r))!tt.call(t,s)&&s!==o&&a(t,s,{get:()=>r[s],enumerable:!(n=K(r,s))||n.enumerable});return t},p=(t,r,o)=>(c(t,r,"default"),o&&c(o,r,"default")),g=(t,r,o)=>(o=t!=null?Z(q(t)):{},c(r||!t||!t.__esModule?a(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>c(a({},"__esModule",{value:!0}),t);var at={};C(at,{getStatusLevel:()=>E,getUrlLevel:()=>H,prettyContent:()=>I,prettyLevel:()=>S,prettyMarker:()=>Y,prettyMethod:()=>U,prettyNs:()=>A,prettyPath:()=>z,prettyReqId:()=>G,prettySize:()=>J,prettyStatus:()=>D,prettyTime:()=>V,prettyUrl:()=>N});module.exports=rt(at);var O=require("@lskjs/colors"),P=require("@lskjs/env"),$=g(require("pretty-bytes")),T=g(require("pretty-time"));var F={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},h=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],d=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var y=require("@lskjs/colors");var x=e(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,o)=>{let n=(r<<5)-r+o.charCodeAt(0);return n&n},0)-48),"hashCode"),W=x;function b(t,r){let o=h[W(r||"")%h.length]||[];return(0,y.colorize)(t,o)}e(b,"themeizeRandom");function f(t,r){let o=r?F[r]:[];return(0,y.colorize)(t,o)}e(f,"themeize");var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var nt=require("@lskjs/algos");var et=require("@lskjs/algos"),L=require("@lskjs/env");var w=require("@lskjs/err");var l={};C(l,{default:()=>M.default,stringify:()=>v.default});p(l,require("fast-safe-stringify"));var v=g(require("fast-safe-stringify")),M=g(require("fast-safe-stringify"));var ot=require("@lskjs/env");var m=e(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),_=e(t=>Boolean(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var st=(0,P.getEnvVar)("LOG_VIEW","short"),u=e((t,r)=>String(t).padStart(r),"leftPad"),it=e((t,r)=>String(t).padEnd(r),"rightPad"),B=20,z=e((t,r=0)=>(B=Math.max(t&&t.length||0,B,r),it(t,B)),"prettyPath"),E=e(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),D=e(t=>{let r=E(t);return r||(r=t!==200?"log":null),f(u(String(t),3),r)},"prettyStatus"),G=e(t=>u(`#${t}`,3),"prettyReqId"),U=e(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return f(u(t,4),r)},"prettyMethod"),V=e((t,r="")=>{if(!Number.isFinite(t))return null;let o=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",Q=Math.floor(Math.abs(t)*10**6),X=(0,T.default)(Q,s);return f(u(X,5),o)},"prettyTime"),J=e((t,r="")=>{if(!Number.isFinite(t))return null;let o=(0,$.default)(t,{maximumFractionDigits:1}).split(" "),n=o[1];return`${+o[0]>=100?Math.round(+o[0]):+o[0]}${r}${n}`},"prettySize"),A=e((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>b(n,n)).join(":"),"prettyNs");function Y(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],o=r[x(t)%r.length];return b(o,String(t))}e(Y,"prettyMarker");var S=e(t=>{let r=st==="short"?(t[0]||"").toLowerCase():u(t,5);return r=`[${r}]`,f(r,t)},"prettyLevel"),lt=/\[[^"\]]+]/gm,I=e((...t)=>{let r=[];return t.forEach(o=>{if(typeof o=="string"){let n=0;r.push(o.replace(lt,s=>(0,O.colorize)(s,d[n++%d.length])))}else r.push(o)}),r},"prettyContent"),H=e(t=>E(t.status)||_(t)?"debug":"trace","getUrlLevel"),N=e(t=>{let r=_(t),o=H(t);return[S(o),[Y(t.reqId),U(t.method)].join(""),z(t.url),G(t.reqId),r&&t.method!=="WS"?D(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&V(t.duration),r&&t.method!=="WS"?J(t.length):null].filter(Boolean).join(" ")},"prettyUrl");0&&(module.exports={getStatusLevel,getUrlLevel,prettyContent,prettyLevel,prettyMarker,prettyMethod,prettyNs,prettyPath,prettyReqId,prettySize,prettyStatus,prettyTime,prettyUrl});
"use strict";var Z=Object.create;var a=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var e=(t,r)=>a(t,"name",{value:r,configurable:!0});var C=(t,r)=>{for(var o in r)a(t,o,{get:r[o],enumerable:!0})},c=(t,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of j(r))!tt.call(t,s)&&s!==o&&a(t,s,{get:()=>r[s],enumerable:!(n=K(r,s))||n.enumerable});return t},p=(t,r,o)=>(c(t,r,"default"),o&&c(o,r,"default")),g=(t,r,o)=>(o=t!=null?Z(q(t)):{},c(r||!t||!t.__esModule?a(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>c(a({},"__esModule",{value:!0}),t);var at={};C(at,{getStatusLevel:()=>E,getUrlLevel:()=>H,prettyContent:()=>I,prettyLevel:()=>S,prettyMarker:()=>Y,prettyMethod:()=>U,prettyNs:()=>A,prettyPath:()=>z,prettyReqId:()=>G,prettySize:()=>J,prettyStatus:()=>D,prettyTime:()=>V,prettyUrl:()=>P});module.exports=rt(at);var N=require("@lskjs/colors"),O=require("@lskjs/env"),$=g(require("pretty-bytes")),T=g(require("pretty-time"));var F={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},h=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],d=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var y=require("@lskjs/colors");var x=e(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,o)=>{let n=(r<<5)-r+o.charCodeAt(0);return n&n},0)-48),"hashCode"),W=x;function b(t,r){let o=h[W(r||"")%h.length]||[];return(0,y.colorize)(t,o)}e(b,"themeizeRandom");function f(t,r){let o=r?F[r]:[];return(0,y.colorize)(t,o)}e(f,"themeize");var i;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(i||(i={}));var nt=require("@lskjs/algos");var et=require("@lskjs/algos"),L=require("@lskjs/env");var w=require("@lskjs/err");var l={};C(l,{default:()=>M.default,stringify:()=>v.default});p(l,require("fast-safe-stringify"));var v=g(require("fast-safe-stringify")),M=g(require("fast-safe-stringify"));var ot=require("@lskjs/env");var m=e(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),_=e(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var st=(0,O.getEnvVar)("LOG_VIEW","short"),u=e((t,r)=>String(t).padStart(r),"leftPad"),it=e((t,r)=>String(t).padEnd(r),"rightPad"),B=20,z=e((t,r=0)=>(B=Math.max(t&&t.length||0,B,r),it(t,B)),"prettyPath"),E=e(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),D=e(t=>{let r=E(t);return r||(r=t!==200?"log":null),f(u(String(t),3),r)},"prettyStatus"),G=e(t=>u(`#${t}`,3),"prettyReqId"),U=e(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return f(u(t,4),r)},"prettyMethod"),V=e((t,r="")=>{if(!Number.isFinite(t))return null;let o=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",Q=Math.floor(Math.abs(t)*10**6),X=(0,T.default)(Q,s);return f(u(X,5),o)},"prettyTime"),J=e((t,r="")=>{if(!Number.isFinite(t))return null;let o=(0,$.default)(t,{maximumFractionDigits:1}).split(" "),n=o[1];return`${+o[0]>=100?Math.round(+o[0]):+o[0]}${r}${n}`},"prettySize"),A=e((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>b(n,n)).join(":"),"prettyNs");function Y(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],o=r[x(t)%r.length];return b(o,String(t))}e(Y,"prettyMarker");var S=e(t=>{let r=st==="short"?(t[0]||"").toLowerCase():u(t,5);return r=`[${r}]`,f(r,t)},"prettyLevel"),lt=/\[[^"\]]+]/gm,I=e((...t)=>{let r=[];return t.forEach(o=>{if(typeof o=="string"){let n=0;r.push(o.replace(lt,s=>(0,N.colorize)(s,d[n++%d.length])))}else r.push(o)}),r},"prettyContent"),H=e(t=>E(t.status)||_(t)?"debug":"trace","getUrlLevel"),P=e(t=>{let r=_(t),o=H(t);return[S(o),[Y(t.reqId),U(t.method)].join(""),z(t.url),G(t.reqId),r&&t.method!=="WS"?D(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&V(t.duration),r&&t.method!=="WS"?J(t.length):null].filter(Boolean).join(" ")},"prettyUrl");0&&(module.exports={getStatusLevel,getUrlLevel,prettyContent,prettyLevel,prettyMarker,prettyMethod,prettyNs,prettyPath,prettyReqId,prettySize,prettyStatus,prettyTime,prettyUrl});
//# sourceMappingURL=utils.js.map

@@ -1,2 +0,2 @@

"use strict";var et=Object.create;var m=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var o=(t,r)=>m(t,"name",{value:r,configurable:!0});var I=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of nt(r))!it.call(t,s)&&s!==e&&m(t,s,{get:()=>r[s],enumerable:!(n=ot(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?et(st(t)):{},b(r||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),lt=t=>b(m({},"__esModule",{value:!0}),t);var _t={};I(_t,{Logger:()=>y,default:()=>B});module.exports=lt(_t);var rt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var at=require("@lskjs/algos"),h=require("@lskjs/env");var O=h.isDev||h.isClient?"pretty":"lsk";var c;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(c||(c={}));var u=require("@lskjs/err");var p={};I(p,{default:()=>P.default,stringify:()=>k.default});L(p,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),P=v(require("fast-safe-stringify"));var f=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var $=o(t=>t.map(r=>(0,u.isError)(r)?(0,u.getCode)(r):null).filter(Boolean)[0],"getErrCode"),T=o(t=>t.length?t.map(r=>(0,u.isError)(r)?(0,u.getMessage)(r):f(r)).join(" "):null,"createMsg");var ft=require("@lskjs/env");var ut={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var D=o(t=>{let{level:r,time:e,...n}=t;return f({level:ut[r],time:e.toISOString(),...n})},"stringifyBunyan");var ct={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var G=o(t=>{let{level:r,time:e,...n}=t;return f({level:ct[r],time:e.toISOString(),...n})},"stringifyLogrus");var g=o(t=>Boolean(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),E=o(t=>Boolean(g(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var U=o(t=>{let{level:r,time:e,...n}=t;return f({level:r,time:+e,...n})},"stringifyLsklog");function V(t,r,...e){let n=$(e),s=T(e),i={code:n,...r,msg:s};return t==="bunyan"?D(i):t==="logrus"?G(i):U(i)}o(V,"stringify");var Y=require("@lskjs/colors"),H=require("@lskjs/env"),Q=v(require("pretty-bytes")),X=v(require("pretty-time"));var F=require("@lskjs/colors");var C=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),J=C;function W(t,r){let e=S[J(r||"")%S.length]||[];return(0,F.colorize)(t,e)}o(W,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,F.colorize)(t,e)}o(d,"themeize");var pt=(0,H.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),gt=o((t,r)=>String(t).padEnd(r),"rightPad"),M=20,mt=o((t,r=0)=>(M=Math.max(t&&t.length||0,M,r),gt(t,M)),"prettyPath"),Z=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),ht=o(t=>{let r=Z(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),dt=o(t=>x(`#${t}`,3),"prettyReqId"),xt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),yt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,X.default)(i,s);return d(x(l,5),e)},"prettyTime"),bt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,Q.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),K=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>W(n,n)).join(":"),"prettyNs");function Lt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[C(t)%r.length];return W(e,String(t))}o(Lt,"prettyMarker");var R=o(t=>{let r=pt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),vt=/\[[^"\]]+]/gm,j=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(vt,s=>(0,Y.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),kt=o(t=>Z(t.status)||E(t)?"debug":"trace","getUrlLevel"),q=o(t=>{let r=E(t),e=kt(t);return[R(e),[Lt(t.reqId),xt(t.method)].join(""),mt(t.url),dt(t.reqId),r&&t.method!=="WS"?ht(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&yt(t.duration),r&&t.method!=="WS"?bt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function wt(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(wt,"countInRow");function St(...t){let r=wt(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(St,"concatFirstStrings");function tt(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(g(t))return[q(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[R(s)];return(l.length||n)&&a.push(K(l,n)),St(...a,...j(...i))}o(tt,"prettyFormat");function A(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(A,"anyRegExps");var y=class{format=O;level="trace";on=[];off=[];constructor(r={}){this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&A(this.off,this.ns)?!1:this.ns&&A(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(g(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,rt.omitNull)(i);if(this.format==="pretty"){this.log(...tt(a,...l));return}this.log(V(this.format||"lsk",a,...l))}};o(y,"Logger");var B=y;0&&(module.exports={Logger});
"use strict";var st=Object.create;var h=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var o=(t,r)=>h(t,"name",{value:r,configurable:!0});var P=(t,r)=>{for(var e in r)h(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of lt(r))!ft.call(t,s)&&s!==e&&h(t,s,{get:()=>r[s],enumerable:!(n=it(r,s))||n.enumerable});return t},L=(t,r,e)=>(b(t,r,"default"),e&&b(e,r,"default")),v=(t,r,e)=>(e=t!=null?st(at(t)):{},b(r||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t)),ut=t=>b(h({},"__esModule",{value:!0}),t);var Et={};P(Et,{Logger:()=>y,default:()=>E});module.exports=ut(Et);var nt=require("@lskjs/algos");var w={start:99,log:99,fatal:60,error:50,warn:40,success:35,info:30,debug:20,trace:10},N={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},S=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]],_=[["bold","white"],["bold","cyan"],["bold","green"],["white"]];var $=require("@lskjs/algos"),f=require("@lskjs/env");function O(t=""){let r=[],e=[],n,s=(typeof t=="string"?t:"").split(/[\s,]+/);for(n=0;n<s.length;n++){if(!s[n])continue;let i=s[n].replace(/\*/g,".*?");i[0]==="-"?e.push(new RegExp(`^${i.slice(1)}$`)):r.push(new RegExp(`^${i}$`))}return{on:r,off:e}}o(O,"parseNs");var B=f.isDev||f.isClient?"pretty":"lsk",T=o(()=>{let t=(0,f.getEnvVar)("DEBUG","")||"",r=process.argv?.includes("--silent"),e=t.startsWith("lsk")||t.startsWith("*"),n=(0,f.getEnvVar)("LOG_FORMAT",(0,f.getEnvVar)("DEBUG_FORMAT",B)),{on:s,off:i}=O(t),a=(0,f.getEnvVar)("LOG_LEVEL",(0,f.getEnvVar)("DEBUG_LEVEL",r?"error":e?"trace":"debug"));return(0,$.omitNull)({format:n,level:a,on:s,off:i})},"getEnvConfig");var p;(function(t){t.bunyan="bunyan",t.lsklog="lsklog",t.lsklogweb="lsklogweb",t.logrus="logrus",t.raw="raw"})(p||(p={}));var c=require("@lskjs/err");var g={};P(g,{default:()=>z.default,stringify:()=>k.default});L(g,require("fast-safe-stringify"));var k=v(require("fast-safe-stringify")),z=v(require("fast-safe-stringify"));var u=o((t,r=null,e=0)=>typeof t=="object"?(0,k.default)(t,r,e):String(t),"toString");var D=o(t=>t.map(r=>(0,c.isError)(r)?(0,c.getCode)(r):null).filter(Boolean)[0],"getErrCode"),G=o(t=>t.length?t.map(r=>(0,c.isError)(r)?(0,c.getMessage)(r):u(r)).join(" "):null,"createMsg");var ct=require("@lskjs/env");var pt={log:10,trace:10,debug:20,info:30,warn:40,error:50,fatal:60};var V=o(t=>{let{level:r,time:e,...n}=t;return u({level:pt[r],time:e.toISOString(),...n})},"stringifyBunyan");var gt={log:"trace",trace:"trace",debug:"debug",info:"info",warn:"warning",error:"error",fatal:"fatal"};var J=o(t=>{let{level:r,time:e,...n}=t;return u({level:gt[r],time:e.toISOString(),...n})},"stringifyLogrus");var m=o(t=>!!(t&&(t.name==="req"||t.method&&t.host&&t.url)),"isLsklogWeb"),C=o(t=>!!(m(t)&&(t.status||t.duration||t.length)),"isLsklogWebFinal");var Y=o(t=>{let{level:r,time:e,...n}=t;return u({level:r,time:+e,...n})},"stringifyLsklog");function H(t,r,...e){let n=D(e),s=G(e),i={code:n,...r,msg:s};return t==="bunyan"?V(i):t==="logrus"?J(i):Y(i)}o(H,"stringify");var X=require("@lskjs/colors"),Z=require("@lskjs/env"),K=v(require("pretty-bytes")),j=v(require("pretty-time"));var W=require("@lskjs/colors");var F=o(t=>typeof t=="number"?t:Math.abs(String(t).split("").reduce((r,e)=>{let n=(r<<5)-r+e.charCodeAt(0);return n&n},0)-48),"hashCode"),Q=F;function M(t,r){let e=S[Q(r||"")%S.length]||[];return(0,W.colorize)(t,e)}o(M,"themeizeRandom");function d(t,r){let e=r?N[r]:[];return(0,W.colorize)(t,e)}o(d,"themeize");var mt=(0,Z.getEnvVar)("LOG_VIEW","short"),x=o((t,r)=>String(t).padStart(r),"leftPad"),ht=o((t,r)=>String(t).padEnd(r),"rightPad"),R=20,dt=o((t,r=0)=>(R=Math.max(t&&t.length||0,R,r),ht(t,R)),"prettyPath"),q=o(t=>t>=500?"error":t>=400?"warn":t>=300?"debug":null,"getStatusLevel"),xt=o(t=>{let r=q(t);return r||(r=t!==200?"log":null),d(x(String(t),3),r)},"prettyStatus"),yt=o(t=>x(`#${t}`,3),"prettyReqId"),bt=o(t=>{let r=t==="REMOVE"?"error":t==="WS"?"debug":null;return d(x(t,4),r)},"prettyMethod"),Lt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=t>=10*1e3?"error":t>=3*1e3?"warn":null,s=["m","s","ms"].includes(r)?r:"",i=Math.floor(Math.abs(t)*10**6),l=(0,j.default)(i,s);return d(x(l,5),e)},"prettyTime"),vt=o((t,r="")=>{if(!Number.isFinite(t))return null;let e=(0,K.default)(t,{maximumFractionDigits:1}).split(" "),n=e[1];return`${+e[0]>=100?Math.round(+e[0]):+e[0]}${r}${n}`},"prettySize"),tt=o((t,r)=>[...t,r].filter(Boolean).map(String).map(n=>M(n,n)).join(":"),"prettyNs");function kt(t){let r=["\u25CB","\u2022","\u2660","\u2660","\u2666","\u2665","\u263C","\u2642","\u2640","\u266A","\xA7"],e=r[F(t)%r.length];return M(e,String(t))}o(kt,"prettyMarker");var A=o(t=>{let r=mt==="short"?(t[0]||"").toLowerCase():x(t,5);return r=`[${r}]`,d(r,t)},"prettyLevel"),wt=/\[[^"\]]+]/gm,rt=o((...t)=>{let r=[];return t.forEach(e=>{if(typeof e=="string"){let n=0;r.push(e.replace(wt,s=>(0,X.colorize)(s,_[n++%_.length])))}else r.push(e)}),r},"prettyContent"),St=o(t=>q(t.status)||C(t)?"debug":"trace","getUrlLevel"),et=o(t=>{let r=C(t),e=St(t);return[A(e),[kt(t.reqId),bt(t.method)].join(""),dt(t.url),yt(t.reqId),r&&t.method!=="WS"?xt(t.status):null,!r&&"\u29D7\u29D6\u29D7",r&&Lt(t.duration),r&&t.method!=="WS"?vt(t.length):null].filter(Boolean).join(" ")},"prettyUrl");function _t(t,r){let e=0;return t.forEach((n,s)=>{s===e&&r(n)&&(e+=1)}),e}o(_t,"countInRow");function Bt(...t){let r=_t(t,e=>typeof e=="string");return[t.slice(0,r).join(" "),...t.slice(r)]}o(Bt,"concatFirstStrings");function ot(t,...r){let e=t?.ns,n=t?.name,s=t?.level||"log",i=r;if(m(t))return[et(t)];let l=(e||"").split(":").filter(Boolean).map(String),a=[A(s)];return(l.length||n)&&a.push(tt(l,n)),Bt(...a,...rt(...i))}o(ot,"prettyFormat");function I(t,r){Array.isArray(t)||(t=[t]);for(let e=0;e<t.length;e++)if(t[e].test(r))return!0;return!1}o(I,"anyRegExps");var y=class{prefix;ns;name;format=B;level="trace";on=[];off=[];constructor(r={}){typeof r=="string"?this.setProps({name:r,...T()}):this.setProps(r)}setProps({prefix:r,ns:e,name:n,level:s,format:i,on:l=[],off:a=[]}){if(r&&(this.prefix=r),e&&(this.ns=e),l&&(this.on=l),a&&(this.off=a),n&&(this.name=n),i&&(this.format=i),s){if(!w[s])throw new Error(`Incorrect level: ${this.level}`);this.level=s}this.level||(this.level="trace"),this.level||(this.level="trace"),this.format||(this.format="lsk"),this.off||(this.off=[]),this.on||(this.on=[])}static create(r){return new this(r)}createChild(...r){let e=[this.ns,this.name].filter(Boolean).join(".");return new this.constructor(this,{colors:null,ns:e},...r)}getLevelPriority(r){return w[r]||0}canLog(r){let e=this.getLevelPriority(r),n=this.getLevelPriority(this.level);return this.ns&&I(this.off,this.ns)?!1:this.ns&&I(this.on,this.ns)?!0:e>=n}fatal(...r){this.canLog("fatal")&&this.__log("fatal",...r)}error(...r){this.canLog("error")&&this.__log("error",...r)}warn(...r){this.canLog("warn")&&this.__log("warn",...r)}debug(...r){this.canLog("debug")&&this.__log("debug",...r)}info(...r){this.canLog("info")&&this.__log("info",...r)}trace(...r){this.canLog("trace")&&this.__log("trace",...r)}log(...r){console._log?console._log(...r):console.log(...r)}__log(r,...e){let[n,...s]=e,i={name:this.name,ns:this.ns,level:r,time:new Date},l=e;if(m(n)&&(i={...i,...n},l=s),this.format==="none")return;let a=(0,nt.omitNull)(i);if(this.format==="pretty"){this.log(...ot(a,...l));return}this.log(H(this.format||"lsk",a,...l))}};o(y,"Logger");var E=y;0&&(module.exports={Logger});
//# sourceMappingURL=server.js.map

@@ -1,2 +0,2 @@

"use strict";var s=Object.create;var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var b=(r,f)=>{for(var o in f)p(r,o,{get:f[o],enumerable:!0})},m=(r,f,o,x)=>{if(f&&typeof f=="object"||typeof f=="function")for(let e of g(f))!y.call(r,e)&&e!==o&&p(r,e,{get:()=>f[e],enumerable:!(x=u(f,e))||x.enumerable});return r},a=(r,f,o)=>(m(r,f,"default"),o&&m(o,f,"default")),d=(r,f,o)=>(o=r!=null?s(n(r)):{},m(f||!r||!r.__esModule?p(o,"default",{value:r,enumerable:!0}):o,r)),c=r=>m(p({},"__esModule",{value:!0}),r);var t={};b(t,{default:()=>l.default,stringify:()=>i.default});module.exports=c(t);a(t,require("fast-safe-stringify"),module.exports);var i=d(require("fast-safe-stringify")),l=d(require("fast-safe-stringify"));0&&(module.exports={stringify});
"use strict";var s=Object.create;var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var b=(r,f)=>{for(var o in f)p(r,o,{get:f[o],enumerable:!0})},m=(r,f,o,x)=>{if(f&&typeof f=="object"||typeof f=="function")for(let e of g(f))!y.call(r,e)&&e!==o&&p(r,e,{get:()=>f[e],enumerable:!(x=u(f,e))||x.enumerable});return r},a=(r,f,o)=>(m(r,f,"default"),o&&m(o,f,"default")),d=(r,f,o)=>(o=r!=null?s(n(r)):{},m(f||!r||!r.__esModule?p(o,"default",{value:r,enumerable:!0}):o,r)),c=r=>m(p({},"__esModule",{value:!0}),r);var t={};b(t,{default:()=>l.default,stringify:()=>i.default});module.exports=c(t);a(t,require("fast-safe-stringify"),module.exports);var i=d(require("fast-safe-stringify")),l=d(require("fast-safe-stringify"));0&&(module.exports={stringify,...require("fast-safe-stringify")});
//# sourceMappingURL=stringify.js.map
{
"name": "@lskjs/log",
"version": "3.3.0",
"version": "3.5.0",
"description": "Yet another logger whitch combines the best features of debug, bunyan, logfmt/logrus, morgan/winston",

@@ -63,3 +63,3 @@ "author": "Igor Suvorov <hi@isuvorov.com> (https://github.com/isuvorov)",

],
"gitHead": "04ef6d9925d23a0042d287ef7cd4ab95a471fa16"
"gitHead": "e8481793f91a75e4ffc702a08738a9f77e1808b0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc