@socketsecurity/lib 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/abort.js +60 -1
  3. package/dist/abort.js.map +2 -2
  4. package/dist/agent.js +289 -1
  5. package/dist/agent.js.map +2 -2
  6. package/dist/ansi.js +60 -1
  7. package/dist/ansi.js.map +2 -2
  8. package/dist/argv/flags.js +282 -1
  9. package/dist/argv/flags.js.map +2 -2
  10. package/dist/argv/parse.js +171 -1
  11. package/dist/argv/parse.js.map +2 -2
  12. package/dist/arrays.js +85 -1
  13. package/dist/arrays.js.map +2 -2
  14. package/dist/bin.js +419 -5
  15. package/dist/bin.js.map +2 -2
  16. package/dist/cacache.js +139 -1
  17. package/dist/cacache.js.map +2 -2
  18. package/dist/cache-with-ttl.js +223 -1
  19. package/dist/cache-with-ttl.js.map +2 -2
  20. package/dist/constants/agents.js +126 -1
  21. package/dist/constants/agents.js.map +2 -2
  22. package/dist/constants/core.d.ts +1 -1
  23. package/dist/constants/core.js +57 -2
  24. package/dist/constants/core.js.map +3 -3
  25. package/dist/constants/encoding.js +48 -1
  26. package/dist/constants/encoding.js.map +2 -2
  27. package/dist/constants/github.js +30 -1
  28. package/dist/constants/github.js.map +2 -2
  29. package/dist/constants/licenses.js +66 -1
  30. package/dist/constants/licenses.js.map +2 -2
  31. package/dist/constants/node.js +185 -1
  32. package/dist/constants/node.js.map +2 -2
  33. package/dist/constants/packages.js +128 -1
  34. package/dist/constants/packages.js.map +2 -2
  35. package/dist/constants/paths.js +150 -1
  36. package/dist/constants/paths.js.map +2 -2
  37. package/dist/constants/platform.js +41 -1
  38. package/dist/constants/platform.js.map +2 -2
  39. package/dist/constants/process.js +52 -1
  40. package/dist/constants/process.js.map +2 -2
  41. package/dist/constants/socket.js +102 -1
  42. package/dist/constants/socket.js.map +2 -2
  43. package/dist/constants/testing.js +36 -1
  44. package/dist/constants/testing.js.map +2 -2
  45. package/dist/constants/time.js +39 -1
  46. package/dist/constants/time.js.map +2 -2
  47. package/dist/constants/typescript.js +54 -1
  48. package/dist/constants/typescript.js.map +2 -2
  49. package/dist/cover/code.js +135 -1
  50. package/dist/cover/code.js.map +2 -2
  51. package/dist/cover/formatters.js +101 -11
  52. package/dist/cover/formatters.js.map +2 -2
  53. package/dist/cover/type.js +63 -1
  54. package/dist/cover/type.js.map +2 -2
  55. package/dist/cover/types.js +15 -1
  56. package/dist/cover/types.js.map +2 -2
  57. package/dist/debug.js +337 -2
  58. package/dist/debug.js.map +2 -2
  59. package/dist/dlx-binary.js +408 -7
  60. package/dist/dlx-binary.js.map +2 -2
  61. package/dist/dlx-package.js +278 -7
  62. package/dist/dlx-package.js.map +2 -2
  63. package/dist/dlx.js +214 -7
  64. package/dist/dlx.js.map +3 -3
  65. package/dist/effects/pulse-frames.js +64 -1
  66. package/dist/effects/pulse-frames.js.map +2 -2
  67. package/dist/effects/text-shimmer.js +174 -1
  68. package/dist/effects/text-shimmer.js.map +2 -2
  69. package/dist/effects/types.js +15 -1
  70. package/dist/effects/types.js.map +2 -2
  71. package/dist/effects/ultra.js +61 -1
  72. package/dist/effects/ultra.js.map +2 -2
  73. package/dist/env/ci.js +31 -1
  74. package/dist/env/ci.js.map +2 -2
  75. package/dist/env/debug.js +30 -1
  76. package/dist/env/debug.js.map +2 -2
  77. package/dist/env/github.js +65 -1
  78. package/dist/env/github.js.map +2 -2
  79. package/dist/env/helpers.js +47 -1
  80. package/dist/env/helpers.js.map +2 -2
  81. package/dist/env/home.js +30 -1
  82. package/dist/env/home.js.map +2 -2
  83. package/dist/env/locale.js +40 -1
  84. package/dist/env/locale.js.map +2 -2
  85. package/dist/env/node-auth-token.js +30 -1
  86. package/dist/env/node-auth-token.js.map +2 -2
  87. package/dist/env/node-env.js +30 -1
  88. package/dist/env/node-env.js.map +2 -2
  89. package/dist/env/npm.js +50 -1
  90. package/dist/env/npm.js.map +2 -2
  91. package/dist/env/package-manager.js +73 -1
  92. package/dist/env/package-manager.js.map +2 -2
  93. package/dist/env/path.js +30 -1
  94. package/dist/env/path.js.map +2 -2
  95. package/dist/env/pre-commit.js +31 -1
  96. package/dist/env/pre-commit.js.map +2 -2
  97. package/dist/env/rewire.js +72 -1
  98. package/dist/env/rewire.js.map +2 -2
  99. package/dist/env/shell.js +30 -1
  100. package/dist/env/shell.js.map +2 -2
  101. package/dist/env/socket-cli-shadow.js +51 -1
  102. package/dist/env/socket-cli-shadow.js.map +2 -2
  103. package/dist/env/socket-cli.js +86 -1
  104. package/dist/env/socket-cli.js.map +2 -2
  105. package/dist/env/socket.js +101 -1
  106. package/dist/env/socket.js.map +2 -2
  107. package/dist/env/temp-dir.js +40 -1
  108. package/dist/env/temp-dir.js.map +2 -2
  109. package/dist/env/term.js +30 -1
  110. package/dist/env/term.js.map +2 -2
  111. package/dist/env/test.js +43 -1
  112. package/dist/env/test.js.map +2 -2
  113. package/dist/env/windows.js +45 -1
  114. package/dist/env/windows.js.map +2 -2
  115. package/dist/env/xdg.js +40 -1
  116. package/dist/env/xdg.js.map +2 -2
  117. package/dist/env.js +170 -1
  118. package/dist/env.js.map +2 -2
  119. package/dist/fs.js +670 -7
  120. package/dist/fs.js.map +2 -2
  121. package/dist/functions.js +68 -1
  122. package/dist/functions.js.map +2 -2
  123. package/dist/git.js +329 -2
  124. package/dist/git.js.map +2 -2
  125. package/dist/github.js +202 -1
  126. package/dist/github.js.map +2 -2
  127. package/dist/globs.js +149 -1
  128. package/dist/globs.js.map +3 -3
  129. package/dist/http-request.js +335 -3
  130. package/dist/http-request.js.map +2 -2
  131. package/dist/index.js +69 -1
  132. package/dist/index.js.map +2 -2
  133. package/dist/ipc.js +244 -1
  134. package/dist/ipc.js.map +2 -2
  135. package/dist/json.js +73 -1
  136. package/dist/json.js.map +2 -2
  137. package/dist/links/index.js +60 -1
  138. package/dist/links/index.js.map +2 -2
  139. package/dist/logger.js +1384 -1
  140. package/dist/logger.js.map +2 -2
  141. package/dist/maintained-node-versions.js +35 -1
  142. package/dist/maintained-node-versions.js.map +2 -2
  143. package/dist/memoization.js +210 -1
  144. package/dist/memoization.js.map +2 -2
  145. package/dist/objects.js +311 -1
  146. package/dist/objects.js.map +2 -2
  147. package/dist/packages/editable.js +356 -9
  148. package/dist/packages/editable.js.map +2 -2
  149. package/dist/packages/exports.js +162 -1
  150. package/dist/packages/exports.js.map +2 -2
  151. package/dist/packages/isolation.js +187 -1
  152. package/dist/packages/isolation.js.map +2 -2
  153. package/dist/packages/licenses.js +214 -1
  154. package/dist/packages/licenses.js.map +2 -2
  155. package/dist/packages/manifest.js +190 -1
  156. package/dist/packages/manifest.js.map +2 -2
  157. package/dist/packages/normalize.js +132 -1
  158. package/dist/packages/normalize.js.map +2 -2
  159. package/dist/packages/operations.js +320 -1
  160. package/dist/packages/operations.js.map +2 -2
  161. package/dist/packages/paths.js +53 -1
  162. package/dist/packages/paths.js.map +2 -2
  163. package/dist/packages/provenance.js +178 -1
  164. package/dist/packages/provenance.js.map +2 -2
  165. package/dist/packages/specs.js +83 -1
  166. package/dist/packages/specs.js.map +2 -2
  167. package/dist/packages/validation.js +51 -1
  168. package/dist/packages/validation.js.map +2 -2
  169. package/dist/packages.js +129 -1
  170. package/dist/packages.js.map +2 -2
  171. package/dist/path.js +446 -1
  172. package/dist/path.js.map +2 -2
  173. package/dist/paths/rewire.js +79 -1
  174. package/dist/paths/rewire.js.map +2 -2
  175. package/dist/paths.js +190 -1
  176. package/dist/paths.js.map +2 -2
  177. package/dist/performance.js +216 -15
  178. package/dist/performance.js.map +2 -2
  179. package/dist/process-lock.js +287 -8
  180. package/dist/process-lock.js.map +2 -2
  181. package/dist/promise-queue.js +109 -1
  182. package/dist/promise-queue.js.map +2 -2
  183. package/dist/promises.js +267 -1
  184. package/dist/promises.js.map +2 -2
  185. package/dist/prompts/index.js +45 -1
  186. package/dist/prompts/index.js.map +2 -2
  187. package/dist/prompts.js +58 -1
  188. package/dist/prompts.js.map +2 -2
  189. package/dist/regexps.js +30 -1
  190. package/dist/regexps.js.map +2 -2
  191. package/dist/sea.js +44 -1
  192. package/dist/sea.js.map +2 -2
  193. package/dist/shadow.js +58 -1
  194. package/dist/shadow.js.map +2 -2
  195. package/dist/signal-exit.js +248 -1
  196. package/dist/signal-exit.js.map +3 -3
  197. package/dist/sorts.js +94 -1
  198. package/dist/sorts.js.map +3 -3
  199. package/dist/spawn.js +200 -1
  200. package/dist/spawn.js.map +2 -2
  201. package/dist/spinner.js +961 -1
  202. package/dist/spinner.js.map +2 -2
  203. package/dist/ssri.js +71 -1
  204. package/dist/ssri.js.map +2 -2
  205. package/dist/stdio/clear.js +82 -1
  206. package/dist/stdio/clear.js.map +2 -2
  207. package/dist/stdio/divider.js +89 -3
  208. package/dist/stdio/divider.js.map +2 -2
  209. package/dist/stdio/footer.js +94 -2
  210. package/dist/stdio/footer.js.map +2 -2
  211. package/dist/stdio/header.js +100 -2
  212. package/dist/stdio/header.js.map +2 -2
  213. package/dist/stdio/mask.js +207 -5
  214. package/dist/stdio/mask.js.map +2 -2
  215. package/dist/stdio/progress.js +209 -2
  216. package/dist/stdio/progress.js.map +2 -2
  217. package/dist/stdio/prompts.js +88 -1
  218. package/dist/stdio/prompts.js.map +2 -2
  219. package/dist/stdio/stderr.js +89 -2
  220. package/dist/stdio/stderr.js.map +2 -2
  221. package/dist/stdio/stdout.js +103 -2
  222. package/dist/stdio/stdout.js.map +2 -2
  223. package/dist/streams.js +78 -1
  224. package/dist/streams.js.map +2 -2
  225. package/dist/strings.js +251 -3
  226. package/dist/strings.js.map +2 -2
  227. package/dist/suppress-warnings.js +98 -1
  228. package/dist/suppress-warnings.js.map +2 -2
  229. package/dist/tables.js +128 -3
  230. package/dist/tables.js.map +2 -2
  231. package/dist/temporary-executor.js +53 -1
  232. package/dist/temporary-executor.js.map +2 -2
  233. package/dist/themes/context.js +71 -1
  234. package/dist/themes/context.js.map +2 -2
  235. package/dist/themes/index.js +57 -1
  236. package/dist/themes/index.js.map +2 -2
  237. package/dist/themes/themes.js +195 -1
  238. package/dist/themes/themes.js.map +2 -2
  239. package/dist/themes/types.js +15 -1
  240. package/dist/themes/types.js.map +2 -2
  241. package/dist/themes/utils.js +116 -1
  242. package/dist/themes/utils.js.map +2 -2
  243. package/dist/types.js +59 -1
  244. package/dist/types.js.map +2 -2
  245. package/dist/url.js +142 -1
  246. package/dist/url.js.map +2 -2
  247. package/dist/utils/get-ipc.js +58 -1
  248. package/dist/utils/get-ipc.js.map +2 -2
  249. package/dist/validation/json-parser.js +127 -1
  250. package/dist/validation/json-parser.js.map +2 -2
  251. package/dist/validation/types.js +15 -1
  252. package/dist/validation/types.js.map +2 -2
  253. package/dist/versions.js +154 -1
  254. package/dist/versions.js.map +2 -2
  255. package/dist/words.js +50 -1
  256. package/dist/words.js.map +2 -2
  257. package/dist/zod.js +27 -1
  258. package/dist/zod.js.map +2 -2
  259. package/package.json +1 -1
package/dist/logger.js CHANGED
@@ -1,3 +1,1386 @@
1
1
  /* Socket Lib - Built with esbuild */
2
- var G=Object.create;var w=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var s in t)w(e,s,{get:t[s],enumerable:!0})},A=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v(t))!N.call(e,o)&&o!==s&&w(e,o,{get:()=>t[o],enumerable:!(n=Y(t,o))||n.enumerable});return e};var W=(e,t,s)=>(s=e!=null?G(H(e)):{},A(t||!e||!e.__esModule?w(s,"default",{value:e,enumerable:!0}):s,e)),z=e=>A(w({},"__esModule",{value:!0}),e);var X={};V(X,{LOG_SYMBOLS:()=>m,Logger:()=>d,getDefaultLogger:()=>Q,incLogCallCountSymbol:()=>l,lastWasBlankSymbol:()=>u});module.exports=z(X);var P=W(require("./external/@socketregistry/is-unicode-supported")),j=W(require("./external/yoctocolors-cjs")),f=require("./strings"),_=require("./themes/context");const y=console,C=Reflect.apply,D=Reflect.construct;let L;function k(...e){return L===void 0&&(L=require("node:console").Console),D(L,e)}function F(){return j.default}function p(e,t,s){return typeof t=="string"?s[t](e):s.rgb(t[0],t[1],t[2])(e)}const m=(()=>{const e={__proto__:null};let t=!1;const s={__proto__:null},n=()=>{const r=(0,P.default)(),c=F(),a=(0,_.getTheme)(),g=a.colors.success,B=a.colors.error,M=a.colors.warning,$=a.colors.info,K=a.colors.step;e.fail=p(r?"\u2716":"\xD7",B,c),e.info=p(r?"\u2139":"i",$,c),e.step=p(r?"\u2192":">",K,c),e.success=p(r?"\u2714":"\u221A",g,c),e.warn=p(r?"\u26A0":"\u203C",M,c)},o=()=>{if(!t){n(),t=!0;for(const r in s)delete s[r]}},i=()=>{t&&n()};for(const r of Reflect.ownKeys(Reflect)){const c=Reflect[r];typeof c=="function"&&(s[r]=(...a)=>(o(),c(...a)))}return(0,_.onThemeChange)(()=>{i()}),new Proxy(e,s)})(),E=["_stderrErrorHandler","_stdoutErrorHandler","assert","clear","count","countReset","createTask","debug","dir","dirxml","error","info","log","table","time","timeEnd","timeLog","trace","warn"].filter(e=>typeof y[e]=="function").map(e=>[e,y[e].bind(y)]),I={__proto__:null,writable:!0,enumerable:!1,configurable:!0},J=1e3,b=new WeakMap,h=new WeakMap;let S;function q(){return S===void 0&&(S=Object.getOwnPropertySymbols(y)),S}const l=Symbol.for("logger.logCallCount++");let x;function R(){return x===void 0&&(x=q().find(e=>e.label==="kGroupIndentWidth")??Symbol("kGroupIndentWidth")),x}const u=Symbol.for("logger.lastWasBlank");class d{static LOG_SYMBOLS=m;#c;#s;#l;#a;#g="";#f="";#p=!1;#y=!1;#h=0;#o;#w;constructor(...t){h.set(this,t);const s=t[0];typeof s=="object"&&s!==null?(this.#o={__proto__:null,...s},this.#w=s.stdout):this.#o={__proto__:null}}#t(){U();let t=b.get(this);if(!t){const s=h.get(this)??[];if(s.length)t=k(...s);else{t=k({stdout:process.stdout,stderr:process.stderr});for(const{0:n,1:o}of E)t[n]=o}b.set(this,t),h.delete(this)}return t}get stderr(){if(!this.#l){const t=h.get(this)??[],s=new d(...t);s.#c=this,s.#s="stderr",s.#o={__proto__:null,...this.#o},this.#l=s}return this.#l}get stdout(){if(!this.#a){const t=h.get(this)??[],s=new d(...t);s.#c=this,s.#s="stdout",s.#o={__proto__:null,...this.#o},this.#a=s}return this.#a}#r(){return this.#c||this}#n(t){const s=this.#r();return t==="stderr"?s.#g:s.#f}#e(t,s){const n=this.#r();t==="stderr"?n.#g=s:n.#f=s}#d(t){const s=this.#r();return t==="stderr"?s.#p:s.#y}#u(t,s){const n=this.#r();t==="stderr"?n.#p=s:n.#y=s}#m(){return this.#s||"stderr"}#k(t,s,n){const o=this.#t(),i=s.at(0),r=typeof i=="string",c=n||(t==="log"?"stdout":"stderr"),a=this.#n(c),g=r?[(0,f.applyLinePrefix)(i,{prefix:a}),...s.slice(1)]:s;return C(o[t],o,g),this[u](r&&(0,f.isBlankString)(g[0]),c),this[l](),this}#b(t){return t.replace(/^[✖✗×⚠‼✔✓√ℹ→]\uFE0F?\s*/u,"")}#i(t,s){const n=this.#t();let o=s.at(0),i;typeof o=="string"?(o=this.#b(o),i=s.slice(1)):(i=s,o="");const r=this.#n("stderr");return n.error((0,f.applyLinePrefix)(`${m[t]} ${o}`,{prefix:r}),...i),this[u](!1,"stderr"),this[l](),this}get logCallCount(){return this.#r().#h}[l](){const t=this.#r();return t.#h+=1,this}[u](t,s){return s?this.#u(s,!!t):this.#s?this.#u(this.#s,!!t):(this.#u("stderr",!!t),this.#u("stdout",!!t)),this}assert(t,...s){return this.#t().assert(t,s[0],...s.slice(1)),this[u](!1),t?this:this[l]()}clearVisible(){if(this.#s)throw new Error("clearVisible() is only available on the main logger instance, not on stream-bound instances");const t=this.#t();return t.clear(),t._stdout.isTTY&&(this[u](!0),this.#h=0),this}count(t){return this.#t().count(t),this[u](!1),this[l]()}createTask(t){return{run:s=>{this.log(`Starting task: ${t}`);const n=s();return this.log(`Completed task: ${t}`),n}}}dedent(t=2){if(this.#s){const s=this.#n(this.#s);this.#e(this.#s,s.slice(0,-t))}else{const s=this.#n("stderr"),n=this.#n("stdout");this.#e("stderr",s.slice(0,-t)),this.#e("stdout",n.slice(0,-t))}return this}dir(t,s){return this.#t().dir(t,s),this[u](!1),this[l]()}dirxml(...t){return this.#t().dirxml(t),this[u](!1),this[l]()}error(...t){return this.#k("error",t)}errorNewline(){return this.#d("stderr")?this:this.error("")}fail(...t){return this.#i("fail",t)}group(...t){const{length:s}=t;return s&&C(this.log,this,t),this.indent(this[R()]),s&&(this[u](!1),this[l]()),this}groupCollapsed(...t){return C(this.group,this,t)}groupEnd(){return this.dedent(this[R()]),this}indent(t=2){const s=" ".repeat(Math.min(t,J));if(this.#s){const n=this.#n(this.#s);this.#e(this.#s,n+s)}else{const n=this.#n("stderr"),o=this.#n("stdout");this.#e("stderr",n+s),this.#e("stdout",o+s)}return this}info(...t){return this.#i("info",t)}log(...t){return this.#k("log",t)}logNewline(){return this.#d("stdout")?this:this.log("")}resetIndent(){return this.#s?this.#e(this.#s,""):(this.#e("stderr",""),this.#e("stdout","")),this}step(t,...s){this.#d("stdout")||this.log("");const n=this.#b(t),o=this.#n("stdout");return this.#t().log((0,f.applyLinePrefix)(`${m.step} ${n}`,{prefix:o}),...s),this[u](!1,"stdout"),this[l](),this}substep(t,...s){const n=` ${t}`;return this.log(n,...s)}success(...t){return this.#i("success",t)}done(...t){return this.#i("success",t)}table(t,s){return this.#t().table(t,s),this[u](!1),this[l]()}timeEnd(t){return this.#t().timeEnd(t),this[u](!1),this[l]()}timeLog(t,...s){return this.#t().timeLog(t,...s),this[u](!1),this[l]()}trace(t,...s){return this.#t().trace(t,...s),this[u](!1),this[l]()}warn(...t){return this.#i("warn",t)}write(t){const s=this.#t(),n=h.get(this)??[];return(this.#w||n[0]?.stdout||s._stdout).write(t),this[u](!1),this}progress(t){const s=this.#t();return(this.#m()==="stderr"?s._stderr:s._stdout).write(`\u2234 ${t}`),this[u](!1),this}clearLine(){const t=this.#t(),n=this.#m()==="stderr"?t._stderr:t._stdout;return n.isTTY?(n.cursorTo(0),n.clearLine(0)):n.write("\r\x1B[K"),this}}let O=!1;function U(){if(O)return;O=!0;const e=[[R(),{...I,value:2}],[Symbol.toStringTag,{__proto__:null,configurable:!0,value:"logger"}]];for(const{0:t,1:s}of Object.entries(y))if(!d.prototype[t]&&typeof s=="function"){const{[t]:n}={[t](...o){let i=b.get(this);if(i===void 0){const c=h.get(this)??[];if(h.delete(this),c.length)i=k(...c);else{i=k({stdout:process.stdout,stderr:process.stderr});for(const{0:a,1:g}of E)i[a]=g}b.set(this,i)}const r=i[t](...o);return r===void 0||r===i?this:r}};e.push([t,{...I,value:n}])}Object.defineProperties(d.prototype,Object.fromEntries(e))}let T;function Q(){return T===void 0&&(T=new d),T}0&&(module.exports={LOG_SYMBOLS,Logger,getDefaultLogger,incLogCallCountSymbol,lastWasBlankSymbol});
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var logger_exports = {};
30
+ __export(logger_exports, {
31
+ LOG_SYMBOLS: () => LOG_SYMBOLS,
32
+ Logger: () => Logger,
33
+ getDefaultLogger: () => getDefaultLogger,
34
+ incLogCallCountSymbol: () => incLogCallCountSymbol,
35
+ lastWasBlankSymbol: () => lastWasBlankSymbol
36
+ });
37
+ module.exports = __toCommonJS(logger_exports);
38
+ var import_is_unicode_supported = __toESM(require("./external/@socketregistry/is-unicode-supported"));
39
+ var import_yoctocolors_cjs = __toESM(require("./external/yoctocolors-cjs"));
40
+ var import_strings = require("./strings");
41
+ var import_context = require("./themes/context");
42
+ const globalConsole = console;
43
+ const ReflectApply = Reflect.apply;
44
+ const ReflectConstruct = Reflect.construct;
45
+ let _Console;
46
+ // @__NO_SIDE_EFFECTS__
47
+ function constructConsole(...args) {
48
+ if (_Console === void 0) {
49
+ const nodeConsole = require("node:console");
50
+ _Console = nodeConsole.Console;
51
+ }
52
+ return ReflectConstruct(
53
+ _Console,
54
+ // eslint-disable-line no-undef
55
+ args
56
+ );
57
+ }
58
+ // @__NO_SIDE_EFFECTS__
59
+ function getYoctocolors() {
60
+ return import_yoctocolors_cjs.default;
61
+ }
62
+ // @__NO_SIDE_EFFECTS__
63
+ function applyColor(text, color, colors) {
64
+ if (typeof color === "string") {
65
+ return colors[color](text);
66
+ }
67
+ return colors.rgb(color[0], color[1], color[2])(text);
68
+ }
69
+ const LOG_SYMBOLS = /* @__PURE__ */ (() => {
70
+ const target = {
71
+ __proto__: null
72
+ };
73
+ let initialized = false;
74
+ const handler = {
75
+ __proto__: null
76
+ };
77
+ const updateSymbols = () => {
78
+ const supported = (0, import_is_unicode_supported.default)();
79
+ const colors = /* @__PURE__ */ getYoctocolors();
80
+ const theme = (0, import_context.getTheme)();
81
+ const successColor = theme.colors.success;
82
+ const errorColor = theme.colors.error;
83
+ const warningColor = theme.colors.warning;
84
+ const infoColor = theme.colors.info;
85
+ const stepColor = theme.colors.step;
86
+ target.fail = /* @__PURE__ */ applyColor(supported ? "\u2716" : "\xD7", errorColor, colors);
87
+ target.info = /* @__PURE__ */ applyColor(supported ? "\u2139" : "i", infoColor, colors);
88
+ target.step = /* @__PURE__ */ applyColor(supported ? "\u2192" : ">", stepColor, colors);
89
+ target.success = /* @__PURE__ */ applyColor(supported ? "\u2714" : "\u221A", successColor, colors);
90
+ target.warn = /* @__PURE__ */ applyColor(supported ? "\u26A0" : "\u203C", warningColor, colors);
91
+ };
92
+ const init = () => {
93
+ if (initialized) {
94
+ return;
95
+ }
96
+ updateSymbols();
97
+ initialized = true;
98
+ for (const trapName in handler) {
99
+ delete handler[trapName];
100
+ }
101
+ };
102
+ const reset = () => {
103
+ if (!initialized) {
104
+ return;
105
+ }
106
+ updateSymbols();
107
+ };
108
+ for (const trapName of Reflect.ownKeys(Reflect)) {
109
+ const fn = Reflect[trapName];
110
+ if (typeof fn === "function") {
111
+ ;
112
+ handler[trapName] = (...args) => {
113
+ init();
114
+ return fn(...args);
115
+ };
116
+ }
117
+ }
118
+ (0, import_context.onThemeChange)(() => {
119
+ reset();
120
+ });
121
+ return new Proxy(target, handler);
122
+ })();
123
+ const boundConsoleEntries = [
124
+ // Add bound properties from console[kBindProperties](ignoreErrors, colorMode, groupIndentation).
125
+ // https://github.com/nodejs/node/blob/v24.0.1/lib/internal/console/constructor.js#L230-L265
126
+ "_stderrErrorHandler",
127
+ "_stdoutErrorHandler",
128
+ // Add methods that need to be bound to function properly.
129
+ "assert",
130
+ "clear",
131
+ "count",
132
+ "countReset",
133
+ "createTask",
134
+ "debug",
135
+ "dir",
136
+ "dirxml",
137
+ "error",
138
+ // Skip group methods because in at least Node 20 with the Node --frozen-intrinsics
139
+ // flag it triggers a readonly property for Symbol(kGroupIndent). Instead, we
140
+ // implement these methods ourselves.
141
+ //'group',
142
+ //'groupCollapsed',
143
+ //'groupEnd',
144
+ "info",
145
+ "log",
146
+ "table",
147
+ "time",
148
+ "timeEnd",
149
+ "timeLog",
150
+ "trace",
151
+ "warn"
152
+ ].filter((n) => typeof globalConsole[n] === "function").map((n) => [n, globalConsole[n].bind(globalConsole)]);
153
+ const consolePropAttributes = {
154
+ __proto__: null,
155
+ writable: true,
156
+ enumerable: false,
157
+ configurable: true
158
+ };
159
+ const maxIndentation = 1e3;
160
+ const privateConsole = /* @__PURE__ */ new WeakMap();
161
+ const privateConstructorArgs = /* @__PURE__ */ new WeakMap();
162
+ let _consoleSymbols;
163
+ function getConsoleSymbols() {
164
+ if (_consoleSymbols === void 0) {
165
+ _consoleSymbols = Object.getOwnPropertySymbols(globalConsole);
166
+ }
167
+ return _consoleSymbols;
168
+ }
169
+ const incLogCallCountSymbol = Symbol.for("logger.logCallCount++");
170
+ let _kGroupIndentationWidthSymbol;
171
+ function getKGroupIndentationWidthSymbol() {
172
+ if (_kGroupIndentationWidthSymbol === void 0) {
173
+ _kGroupIndentationWidthSymbol = getConsoleSymbols().find((s) => s.label === "kGroupIndentWidth") ?? Symbol("kGroupIndentWidth");
174
+ }
175
+ return _kGroupIndentationWidthSymbol;
176
+ }
177
+ const lastWasBlankSymbol = Symbol.for("logger.lastWasBlank");
178
+ class Logger {
179
+ /**
180
+ * Static reference to log symbols for convenience.
181
+ *
182
+ * @example
183
+ * ```typescript
184
+ * console.log(`${Logger.LOG_SYMBOLS.success} Done`)
185
+ * ```
186
+ */
187
+ static LOG_SYMBOLS = LOG_SYMBOLS;
188
+ #parent;
189
+ #boundStream;
190
+ #stderrLogger;
191
+ #stdoutLogger;
192
+ #stderrIndention = "";
193
+ #stdoutIndention = "";
194
+ #stderrLastWasBlank = false;
195
+ #stdoutLastWasBlank = false;
196
+ #logCallCount = 0;
197
+ #options;
198
+ #originalStdout;
199
+ /**
200
+ * Creates a new Logger instance.
201
+ *
202
+ * When called without arguments, creates a logger using the default
203
+ * `process.stdout` and `process.stderr` streams. Can accept custom
204
+ * console constructor arguments for advanced use cases.
205
+ *
206
+ * @param args - Optional console constructor arguments
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * // Default logger
211
+ * const logger = new Logger()
212
+ *
213
+ * // Custom streams (advanced)
214
+ * const customLogger = new Logger({
215
+ * stdout: customWritableStream,
216
+ * stderr: customErrorStream
217
+ * })
218
+ * ```
219
+ */
220
+ constructor(...args) {
221
+ privateConstructorArgs.set(this, args);
222
+ const options = args["0"];
223
+ if (typeof options === "object" && options !== null) {
224
+ this.#options = { __proto__: null, ...options };
225
+ this.#originalStdout = options.stdout;
226
+ } else {
227
+ this.#options = { __proto__: null };
228
+ }
229
+ }
230
+ /**
231
+ * Get the Console instance for this logger, creating it lazily on first access.
232
+ *
233
+ * This lazy initialization allows the logger to be imported during early
234
+ * Node.js bootstrap before stdout is ready, avoiding Console initialization
235
+ * errors (ERR_CONSOLE_WRITABLE_STREAM).
236
+ *
237
+ * @private
238
+ */
239
+ #getConsole() {
240
+ ensurePrototypeInitialized();
241
+ let con = privateConsole.get(this);
242
+ if (!con) {
243
+ const ctorArgs = privateConstructorArgs.get(this) ?? [];
244
+ if (ctorArgs.length) {
245
+ con = /* @__PURE__ */ constructConsole(...ctorArgs);
246
+ } else {
247
+ con = /* @__PURE__ */ constructConsole({
248
+ stdout: process.stdout,
249
+ stderr: process.stderr
250
+ });
251
+ for (const { 0: key, 1: method } of boundConsoleEntries) {
252
+ con[key] = method;
253
+ }
254
+ }
255
+ privateConsole.set(this, con);
256
+ privateConstructorArgs.delete(this);
257
+ }
258
+ return con;
259
+ }
260
+ /**
261
+ * Gets a logger instance bound exclusively to stderr.
262
+ *
263
+ * All logging operations on this instance will write to stderr only.
264
+ * Indentation is tracked separately from stdout. The instance is
265
+ * cached and reused on subsequent accesses.
266
+ *
267
+ * @returns A logger instance bound to stderr
268
+ *
269
+ * @example
270
+ * ```typescript
271
+ * // Write errors to stderr
272
+ * logger.stderr.error('Configuration invalid')
273
+ * logger.stderr.warn('Using fallback settings')
274
+ *
275
+ * // Indent only affects stderr
276
+ * logger.stderr.indent()
277
+ * logger.stderr.error('Nested error details')
278
+ * logger.stderr.dedent()
279
+ * ```
280
+ */
281
+ get stderr() {
282
+ if (!this.#stderrLogger) {
283
+ const ctorArgs = privateConstructorArgs.get(this) ?? [];
284
+ const instance = new Logger(...ctorArgs);
285
+ instance.#parent = this;
286
+ instance.#boundStream = "stderr";
287
+ instance.#options = { __proto__: null, ...this.#options };
288
+ this.#stderrLogger = instance;
289
+ }
290
+ return this.#stderrLogger;
291
+ }
292
+ /**
293
+ * Gets a logger instance bound exclusively to stdout.
294
+ *
295
+ * All logging operations on this instance will write to stdout only.
296
+ * Indentation is tracked separately from stderr. The instance is
297
+ * cached and reused on subsequent accesses.
298
+ *
299
+ * @returns A logger instance bound to stdout
300
+ *
301
+ * @example
302
+ * ```typescript
303
+ * // Write normal output to stdout
304
+ * logger.stdout.log('Processing started')
305
+ * logger.stdout.log('Items processed: 42')
306
+ *
307
+ * // Indent only affects stdout
308
+ * logger.stdout.indent()
309
+ * logger.stdout.log('Detailed output')
310
+ * logger.stdout.dedent()
311
+ * ```
312
+ */
313
+ get stdout() {
314
+ if (!this.#stdoutLogger) {
315
+ const ctorArgs = privateConstructorArgs.get(this) ?? [];
316
+ const instance = new Logger(...ctorArgs);
317
+ instance.#parent = this;
318
+ instance.#boundStream = "stdout";
319
+ instance.#options = { __proto__: null, ...this.#options };
320
+ this.#stdoutLogger = instance;
321
+ }
322
+ return this.#stdoutLogger;
323
+ }
324
+ /**
325
+ * Get the root logger (for accessing shared indentation state).
326
+ * @private
327
+ */
328
+ #getRoot() {
329
+ return this.#parent || this;
330
+ }
331
+ /**
332
+ * Get indentation for a specific stream.
333
+ * @private
334
+ */
335
+ #getIndent(stream) {
336
+ const root = this.#getRoot();
337
+ return stream === "stderr" ? root.#stderrIndention : root.#stdoutIndention;
338
+ }
339
+ /**
340
+ * Set indentation for a specific stream.
341
+ * @private
342
+ */
343
+ #setIndent(stream, value) {
344
+ const root = this.#getRoot();
345
+ if (stream === "stderr") {
346
+ root.#stderrIndention = value;
347
+ } else {
348
+ root.#stdoutIndention = value;
349
+ }
350
+ }
351
+ /**
352
+ * Get lastWasBlank state for a specific stream.
353
+ * @private
354
+ */
355
+ #getLastWasBlank(stream) {
356
+ const root = this.#getRoot();
357
+ return stream === "stderr" ? root.#stderrLastWasBlank : root.#stdoutLastWasBlank;
358
+ }
359
+ /**
360
+ * Set lastWasBlank state for a specific stream.
361
+ * @private
362
+ */
363
+ #setLastWasBlank(stream, value) {
364
+ const root = this.#getRoot();
365
+ if (stream === "stderr") {
366
+ root.#stderrLastWasBlank = value;
367
+ } else {
368
+ root.#stdoutLastWasBlank = value;
369
+ }
370
+ }
371
+ /**
372
+ * Get the target stream for this logger instance.
373
+ * @private
374
+ */
375
+ #getTargetStream() {
376
+ return this.#boundStream || "stderr";
377
+ }
378
+ /**
379
+ * Apply a console method with indentation.
380
+ * @private
381
+ */
382
+ #apply(methodName, args, stream) {
383
+ const con = this.#getConsole();
384
+ const text = args.at(0);
385
+ const hasText = typeof text === "string";
386
+ const targetStream = stream || (methodName === "log" ? "stdout" : "stderr");
387
+ const indent = this.#getIndent(targetStream);
388
+ const logArgs = hasText ? [(0, import_strings.applyLinePrefix)(text, { prefix: indent }), ...args.slice(1)] : args;
389
+ ReflectApply(
390
+ con[methodName],
391
+ con,
392
+ logArgs
393
+ );
394
+ this[lastWasBlankSymbol](hasText && (0, import_strings.isBlankString)(logArgs[0]), targetStream);
395
+ this[incLogCallCountSymbol]();
396
+ return this;
397
+ }
398
+ /**
399
+ * Strip log symbols from the start of text.
400
+ * @private
401
+ */
402
+ #stripSymbols(text) {
403
+ return text.replace(/^[✖✗×⚠‼✔✓√ℹ→]\uFE0F?\s*/u, "");
404
+ }
405
+ /**
406
+ * Apply a method with a symbol prefix.
407
+ * @private
408
+ */
409
+ #symbolApply(symbolType, args) {
410
+ const con = this.#getConsole();
411
+ let text = args.at(0);
412
+ let extras;
413
+ if (typeof text === "string") {
414
+ text = this.#stripSymbols(text);
415
+ extras = args.slice(1);
416
+ } else {
417
+ extras = args;
418
+ text = "";
419
+ }
420
+ const indent = this.#getIndent("stderr");
421
+ con.error(
422
+ (0, import_strings.applyLinePrefix)(`${LOG_SYMBOLS[symbolType]} ${text}`, {
423
+ prefix: indent
424
+ }),
425
+ ...extras
426
+ );
427
+ this[lastWasBlankSymbol](false, "stderr");
428
+ this[incLogCallCountSymbol]();
429
+ return this;
430
+ }
431
+ /**
432
+ * Gets the total number of log calls made on this logger instance.
433
+ *
434
+ * Tracks all logging method calls including `log()`, `error()`, `warn()`,
435
+ * `success()`, `fail()`, etc. Useful for testing and monitoring logging activity.
436
+ *
437
+ * @returns The number of times logging methods have been called
438
+ *
439
+ * @example
440
+ * ```typescript
441
+ * logger.log('Message 1')
442
+ * logger.error('Message 2')
443
+ * console.log(logger.logCallCount) // 2
444
+ * ```
445
+ */
446
+ get logCallCount() {
447
+ const root = this.#getRoot();
448
+ return root.#logCallCount;
449
+ }
450
+ /**
451
+ * Increments the internal log call counter.
452
+ *
453
+ * This is called automatically by logging methods and should not
454
+ * be called directly in normal usage.
455
+ *
456
+ * @returns The logger instance for chaining
457
+ */
458
+ [incLogCallCountSymbol]() {
459
+ const root = this.#getRoot();
460
+ root.#logCallCount += 1;
461
+ return this;
462
+ }
463
+ /**
464
+ * Sets whether the last logged line was blank.
465
+ *
466
+ * Used internally to track blank lines and prevent duplicate spacing.
467
+ * This is called automatically by logging methods.
468
+ *
469
+ * @param value - Whether the last line was blank
470
+ * @param stream - Optional stream to update (defaults to both streams if not bound, or target stream if bound)
471
+ * @returns The logger instance for chaining
472
+ */
473
+ [lastWasBlankSymbol](value, stream) {
474
+ if (stream) {
475
+ this.#setLastWasBlank(stream, !!value);
476
+ } else if (this.#boundStream) {
477
+ this.#setLastWasBlank(this.#boundStream, !!value);
478
+ } else {
479
+ this.#setLastWasBlank("stderr", !!value);
480
+ this.#setLastWasBlank("stdout", !!value);
481
+ }
482
+ return this;
483
+ }
484
+ /**
485
+ * Logs an assertion failure message if the value is falsy.
486
+ *
487
+ * Works like `console.assert()` but returns the logger for chaining.
488
+ * If the value is truthy, nothing is logged. If falsy, logs an error
489
+ * message with an assertion failure.
490
+ *
491
+ * @param value - The value to test
492
+ * @param message - Optional message and additional arguments to log
493
+ * @returns The logger instance for chaining
494
+ *
495
+ * @example
496
+ * ```typescript
497
+ * logger.assert(true, 'This will not log')
498
+ * logger.assert(false, 'Assertion failed: value is false')
499
+ * logger.assert(items.length > 0, 'No items found')
500
+ * ```
501
+ */
502
+ assert(value, ...message) {
503
+ const con = this.#getConsole();
504
+ con.assert(value, message[0], ...message.slice(1));
505
+ this[lastWasBlankSymbol](false);
506
+ return value ? this : this[incLogCallCountSymbol]();
507
+ }
508
+ /**
509
+ * Clears the visible terminal screen.
510
+ *
511
+ * Only available on the main logger instance, not on stream-bound instances
512
+ * (`.stderr` or `.stdout`). Resets the log call count and blank line tracking
513
+ * if the output is a TTY.
514
+ *
515
+ * @returns The logger instance for chaining
516
+ * @throws {Error} If called on a stream-bound logger instance
517
+ *
518
+ * @example
519
+ * ```typescript
520
+ * logger.log('Some output')
521
+ * logger.clearVisible() // Screen is now clear
522
+ *
523
+ * // Error: Can't call on stream-bound instance
524
+ * logger.stderr.clearVisible() // throws
525
+ * ```
526
+ */
527
+ clearVisible() {
528
+ if (this.#boundStream) {
529
+ throw new Error(
530
+ "clearVisible() is only available on the main logger instance, not on stream-bound instances"
531
+ );
532
+ }
533
+ const con = this.#getConsole();
534
+ con.clear();
535
+ if (con._stdout.isTTY) {
536
+ ;
537
+ this[lastWasBlankSymbol](true);
538
+ this.#logCallCount = 0;
539
+ }
540
+ return this;
541
+ }
542
+ /**
543
+ * Increments and logs a counter for the given label.
544
+ *
545
+ * Each unique label maintains its own counter. Works like `console.count()`.
546
+ *
547
+ * @param label - Optional label for the counter
548
+ * @default 'default'
549
+ * @returns The logger instance for chaining
550
+ *
551
+ * @example
552
+ * ```typescript
553
+ * logger.count('requests') // requests: 1
554
+ * logger.count('requests') // requests: 2
555
+ * logger.count('errors') // errors: 1
556
+ * logger.count() // default: 1
557
+ * ```
558
+ */
559
+ count(label) {
560
+ const con = this.#getConsole();
561
+ con.count(label);
562
+ this[lastWasBlankSymbol](false);
563
+ return this[incLogCallCountSymbol]();
564
+ }
565
+ /**
566
+ * Creates a task that logs start and completion messages automatically.
567
+ *
568
+ * Returns a task object with a `run()` method that executes the provided
569
+ * function and logs "Starting task: {name}" before execution and
570
+ * "Completed task: {name}" after completion.
571
+ *
572
+ * @param name - The name of the task
573
+ * @returns A task object with a `run()` method
574
+ *
575
+ * @example
576
+ * ```typescript
577
+ * const task = logger.createTask('Database Migration')
578
+ * const result = task.run(() => {
579
+ * // Logs: "Starting task: Database Migration"
580
+ * migrateDatabase()
581
+ * return 'success'
582
+ * // Logs: "Completed task: Database Migration"
583
+ * })
584
+ * console.log(result) // 'success'
585
+ * ```
586
+ */
587
+ createTask(name) {
588
+ return {
589
+ run: (f) => {
590
+ this.log(`Starting task: ${name}`);
591
+ const result = f();
592
+ this.log(`Completed task: ${name}`);
593
+ return result;
594
+ }
595
+ };
596
+ }
597
+ /**
598
+ * Decreases the indentation level by removing spaces from the prefix.
599
+ *
600
+ * When called on the main logger, affects both stderr and stdout indentation.
601
+ * When called on a stream-bound logger (`.stderr` or `.stdout`), affects
602
+ * only that stream's indentation.
603
+ *
604
+ * @param spaces - Number of spaces to remove from indentation
605
+ * @default 2
606
+ * @returns The logger instance for chaining
607
+ *
608
+ * @example
609
+ * ```typescript
610
+ * logger.indent()
611
+ * logger.log('Indented')
612
+ * logger.dedent()
613
+ * logger.log('Back to normal')
614
+ *
615
+ * // Remove custom amount
616
+ * logger.indent(4)
617
+ * logger.log('Four spaces')
618
+ * logger.dedent(4)
619
+ *
620
+ * // Stream-specific dedent
621
+ * logger.stdout.indent()
622
+ * logger.stdout.log('Indented stdout')
623
+ * logger.stdout.dedent()
624
+ * ```
625
+ */
626
+ dedent(spaces = 2) {
627
+ if (this.#boundStream) {
628
+ const current = this.#getIndent(this.#boundStream);
629
+ this.#setIndent(this.#boundStream, current.slice(0, -spaces));
630
+ } else {
631
+ const stderrCurrent = this.#getIndent("stderr");
632
+ const stdoutCurrent = this.#getIndent("stdout");
633
+ this.#setIndent("stderr", stderrCurrent.slice(0, -spaces));
634
+ this.#setIndent("stdout", stdoutCurrent.slice(0, -spaces));
635
+ }
636
+ return this;
637
+ }
638
+ /**
639
+ * Displays an object's properties in a formatted way.
640
+ *
641
+ * Works like `console.dir()` with customizable options for depth,
642
+ * colors, etc. Useful for inspecting complex objects.
643
+ *
644
+ * @param obj - The object to display
645
+ * @param options - Optional formatting options (Node.js inspect options)
646
+ * @returns The logger instance for chaining
647
+ *
648
+ * @example
649
+ * ```typescript
650
+ * const obj = { a: 1, b: { c: 2, d: { e: 3 } } }
651
+ * logger.dir(obj)
652
+ * logger.dir(obj, { depth: 1 }) // Limit nesting depth
653
+ * logger.dir(obj, { colors: true }) // Enable colors
654
+ * ```
655
+ */
656
+ dir(obj, options) {
657
+ const con = this.#getConsole();
658
+ con.dir(obj, options);
659
+ this[lastWasBlankSymbol](false);
660
+ return this[incLogCallCountSymbol]();
661
+ }
662
+ /**
663
+ * Displays data as XML/HTML in a formatted way.
664
+ *
665
+ * Works like `console.dirxml()`. In Node.js, behaves the same as `dir()`.
666
+ *
667
+ * @param data - The data to display
668
+ * @returns The logger instance for chaining
669
+ *
670
+ * @example
671
+ * ```typescript
672
+ * logger.dirxml(document.body) // In browser environments
673
+ * logger.dirxml(xmlObject) // In Node.js
674
+ * ```
675
+ */
676
+ dirxml(...data) {
677
+ const con = this.#getConsole();
678
+ con.dirxml(data);
679
+ this[lastWasBlankSymbol](false);
680
+ return this[incLogCallCountSymbol]();
681
+ }
682
+ /**
683
+ * Logs an error message to stderr.
684
+ *
685
+ * Automatically applies current indentation. All arguments are formatted
686
+ * and logged like `console.error()`.
687
+ *
688
+ * @param args - Message and additional arguments to log
689
+ * @returns The logger instance for chaining
690
+ *
691
+ * @example
692
+ * ```typescript
693
+ * logger.error('Build failed')
694
+ * logger.error('Error code:', 500)
695
+ * logger.error('Details:', { message: 'Not found' })
696
+ * ```
697
+ */
698
+ error(...args) {
699
+ return this.#apply("error", args);
700
+ }
701
+ /**
702
+ * Logs a newline to stderr only if the last line wasn't already blank.
703
+ *
704
+ * Prevents multiple consecutive blank lines. Useful for adding spacing
705
+ * between sections without creating excessive whitespace.
706
+ *
707
+ * @returns The logger instance for chaining
708
+ *
709
+ * @example
710
+ * ```typescript
711
+ * logger.error('Error message')
712
+ * logger.errorNewline() // Adds blank line
713
+ * logger.errorNewline() // Does nothing (already blank)
714
+ * logger.error('Next section')
715
+ * ```
716
+ */
717
+ errorNewline() {
718
+ return this.#getLastWasBlank("stderr") ? this : this.error("");
719
+ }
720
+ /**
721
+ * Logs a failure message with a red colored fail symbol.
722
+ *
723
+ * Automatically prefixes the message with `LOG_SYMBOLS.fail` (red ✖).
724
+ * Always outputs to stderr. If the message starts with an existing
725
+ * symbol, it will be stripped and replaced.
726
+ *
727
+ * @param args - Message and additional arguments to log
728
+ * @returns The logger instance for chaining
729
+ *
730
+ * @example
731
+ * ```typescript
732
+ * logger.fail('Build failed')
733
+ * logger.fail('Test suite failed:', { passed: 5, failed: 3 })
734
+ * ```
735
+ */
736
+ fail(...args) {
737
+ return this.#symbolApply("fail", args);
738
+ }
739
+ /**
740
+ * Starts a new indented log group.
741
+ *
742
+ * If a label is provided, it's logged before increasing indentation.
743
+ * Groups can be nested. Each group increases indentation by the
744
+ * `kGroupIndentWidth` (default 2 spaces). Call `groupEnd()` to close.
745
+ *
746
+ * @param label - Optional label to display before the group
747
+ * @returns The logger instance for chaining
748
+ *
749
+ * @example
750
+ * ```typescript
751
+ * logger.group('Processing files:')
752
+ * logger.log('file1.js')
753
+ * logger.log('file2.js')
754
+ * logger.groupEnd()
755
+ *
756
+ * // Nested groups
757
+ * logger.group('Outer')
758
+ * logger.log('Outer content')
759
+ * logger.group('Inner')
760
+ * logger.log('Inner content')
761
+ * logger.groupEnd()
762
+ * logger.groupEnd()
763
+ * ```
764
+ */
765
+ group(...label) {
766
+ const { length } = label;
767
+ if (length) {
768
+ ReflectApply(this.log, this, label);
769
+ }
770
+ this.indent(this[getKGroupIndentationWidthSymbol()]);
771
+ if (length) {
772
+ ;
773
+ this[lastWasBlankSymbol](false);
774
+ this[incLogCallCountSymbol]();
775
+ }
776
+ return this;
777
+ }
778
+ /**
779
+ * Starts a new collapsed log group (alias for `group()`).
780
+ *
781
+ * In browser consoles, this creates a collapsed group. In Node.js,
782
+ * it behaves identically to `group()`.
783
+ *
784
+ * @param label - Optional label to display before the group
785
+ * @returns The logger instance for chaining
786
+ *
787
+ * @example
788
+ * ```typescript
789
+ * logger.groupCollapsed('Details')
790
+ * logger.log('Hidden by default in browsers')
791
+ * logger.groupEnd()
792
+ * ```
793
+ */
794
+ // groupCollapsed is an alias of group.
795
+ // https://nodejs.org/api/console.html#consolegroupcollapsed
796
+ groupCollapsed(...label) {
797
+ return ReflectApply(this.group, this, label);
798
+ }
799
+ /**
800
+ * Ends the current log group and decreases indentation.
801
+ *
802
+ * Must be called once for each `group()` or `groupCollapsed()` call
803
+ * to properly close the group and restore indentation.
804
+ *
805
+ * @returns The logger instance for chaining
806
+ *
807
+ * @example
808
+ * ```typescript
809
+ * logger.group('Group 1')
810
+ * logger.log('Content')
811
+ * logger.groupEnd() // Closes 'Group 1'
812
+ * ```
813
+ */
814
+ groupEnd() {
815
+ this.dedent(this[getKGroupIndentationWidthSymbol()]);
816
+ return this;
817
+ }
818
+ /**
819
+ * Increases the indentation level by adding spaces to the prefix.
820
+ *
821
+ * When called on the main logger, affects both stderr and stdout indentation.
822
+ * When called on a stream-bound logger (`.stderr` or `.stdout`), affects
823
+ * only that stream's indentation. Maximum indentation is 1000 spaces.
824
+ *
825
+ * @param spaces - Number of spaces to add to indentation
826
+ * @default 2
827
+ * @returns The logger instance for chaining
828
+ *
829
+ * @example
830
+ * ```typescript
831
+ * logger.log('Level 0')
832
+ * logger.indent()
833
+ * logger.log('Level 1')
834
+ * logger.indent()
835
+ * logger.log('Level 2')
836
+ * logger.dedent()
837
+ * logger.dedent()
838
+ *
839
+ * // Custom indent amount
840
+ * logger.indent(4)
841
+ * logger.log('Indented 4 spaces')
842
+ * logger.dedent(4)
843
+ *
844
+ * // Stream-specific indent
845
+ * logger.stdout.indent()
846
+ * logger.stdout.log('Only stdout is indented')
847
+ * ```
848
+ */
849
+ indent(spaces = 2) {
850
+ const spacesToAdd = " ".repeat(Math.min(spaces, maxIndentation));
851
+ if (this.#boundStream) {
852
+ const current = this.#getIndent(this.#boundStream);
853
+ this.#setIndent(this.#boundStream, current + spacesToAdd);
854
+ } else {
855
+ const stderrCurrent = this.#getIndent("stderr");
856
+ const stdoutCurrent = this.#getIndent("stdout");
857
+ this.#setIndent("stderr", stderrCurrent + spacesToAdd);
858
+ this.#setIndent("stdout", stdoutCurrent + spacesToAdd);
859
+ }
860
+ return this;
861
+ }
862
+ /**
863
+ * Logs an informational message with a blue colored info symbol.
864
+ *
865
+ * Automatically prefixes the message with `LOG_SYMBOLS.info` (blue ℹ).
866
+ * Always outputs to stderr. If the message starts with an existing
867
+ * symbol, it will be stripped and replaced.
868
+ *
869
+ * @param args - Message and additional arguments to log
870
+ * @returns The logger instance for chaining
871
+ *
872
+ * @example
873
+ * ```typescript
874
+ * logger.info('Starting build process')
875
+ * logger.info('Configuration loaded:', config)
876
+ * logger.info('Using cache directory:', cacheDir)
877
+ * ```
878
+ */
879
+ info(...args) {
880
+ return this.#symbolApply("info", args);
881
+ }
882
+ /**
883
+ * Logs a message to stdout.
884
+ *
885
+ * Automatically applies current indentation. All arguments are formatted
886
+ * and logged like `console.log()`. This is the primary method for
887
+ * standard output.
888
+ *
889
+ * @param args - Message and additional arguments to log
890
+ * @returns The logger instance for chaining
891
+ *
892
+ * @example
893
+ * ```typescript
894
+ * logger.log('Processing complete')
895
+ * logger.log('Items processed:', 42)
896
+ * logger.log('Results:', { success: true, count: 10 })
897
+ *
898
+ * // Method chaining
899
+ * logger.log('Step 1').log('Step 2').log('Step 3')
900
+ * ```
901
+ */
902
+ log(...args) {
903
+ return this.#apply("log", args);
904
+ }
905
+ /**
906
+ * Logs a newline to stdout only if the last line wasn't already blank.
907
+ *
908
+ * Prevents multiple consecutive blank lines. Useful for adding spacing
909
+ * between sections without creating excessive whitespace.
910
+ *
911
+ * @returns The logger instance for chaining
912
+ *
913
+ * @example
914
+ * ```typescript
915
+ * logger.log('Section 1')
916
+ * logger.logNewline() // Adds blank line
917
+ * logger.logNewline() // Does nothing (already blank)
918
+ * logger.log('Section 2')
919
+ * ```
920
+ */
921
+ logNewline() {
922
+ return this.#getLastWasBlank("stdout") ? this : this.log("");
923
+ }
924
+ /**
925
+ * Resets all indentation to zero.
926
+ *
927
+ * When called on the main logger, resets both stderr and stdout indentation.
928
+ * When called on a stream-bound logger (`.stderr` or `.stdout`), resets
929
+ * only that stream's indentation.
930
+ *
931
+ * @returns The logger instance for chaining
932
+ *
933
+ * @example
934
+ * ```typescript
935
+ * logger.indent().indent().indent()
936
+ * logger.log('Very indented')
937
+ * logger.resetIndent()
938
+ * logger.log('Back to zero indentation')
939
+ *
940
+ * // Reset only stdout
941
+ * logger.stdout.resetIndent()
942
+ * ```
943
+ */
944
+ resetIndent() {
945
+ if (this.#boundStream) {
946
+ this.#setIndent(this.#boundStream, "");
947
+ } else {
948
+ this.#setIndent("stderr", "");
949
+ this.#setIndent("stdout", "");
950
+ }
951
+ return this;
952
+ }
953
+ /**
954
+ * Logs a main step message with a cyan arrow symbol and blank line before it.
955
+ *
956
+ * Automatically prefixes the message with `LOG_SYMBOLS.step` (cyan →) and
957
+ * adds a blank line before the message unless the last line was already blank.
958
+ * Useful for marking major steps in a process with clear visual separation.
959
+ * Always outputs to stdout. If the message starts with an existing symbol,
960
+ * it will be stripped and replaced.
961
+ *
962
+ * @param msg - The step message to log
963
+ * @param extras - Additional arguments to log
964
+ * @returns The logger instance for chaining
965
+ *
966
+ * @example
967
+ * ```typescript
968
+ * logger.step('Building project')
969
+ * logger.log('Compiling TypeScript...')
970
+ * logger.step('Running tests')
971
+ * logger.log('Running test suite...')
972
+ * // Output:
973
+ * // [blank line]
974
+ * // → Building project
975
+ * // Compiling TypeScript...
976
+ * // [blank line]
977
+ * // → Running tests
978
+ * // Running test suite...
979
+ * ```
980
+ */
981
+ step(msg, ...extras) {
982
+ if (!this.#getLastWasBlank("stdout")) {
983
+ this.log("");
984
+ }
985
+ const text = this.#stripSymbols(msg);
986
+ const indent = this.#getIndent("stdout");
987
+ const con = this.#getConsole();
988
+ con.log(
989
+ (0, import_strings.applyLinePrefix)(`${LOG_SYMBOLS.step} ${text}`, {
990
+ prefix: indent
991
+ }),
992
+ ...extras
993
+ );
994
+ this[lastWasBlankSymbol](false, "stdout");
995
+ this[incLogCallCountSymbol]();
996
+ return this;
997
+ }
998
+ /**
999
+ * Logs an indented substep message (stateless).
1000
+ *
1001
+ * Adds a 2-space indent to the message without affecting the logger's
1002
+ * indentation state. Useful for showing sub-items under a main step.
1003
+ *
1004
+ * @param msg - The substep message to log
1005
+ * @param extras - Additional arguments to log
1006
+ * @returns The logger instance for chaining
1007
+ *
1008
+ * @example
1009
+ * ```typescript
1010
+ * logger.log('Installing dependencies:')
1011
+ * logger.substep('Installing react')
1012
+ * logger.substep('Installing typescript')
1013
+ * logger.substep('Installing eslint')
1014
+ * // Output:
1015
+ * // Installing dependencies:
1016
+ * // Installing react
1017
+ * // Installing typescript
1018
+ * // Installing eslint
1019
+ * ```
1020
+ */
1021
+ substep(msg, ...extras) {
1022
+ const indentedMsg = ` ${msg}`;
1023
+ return this.log(indentedMsg, ...extras);
1024
+ }
1025
+ /**
1026
+ * Logs a success message with a green colored success symbol.
1027
+ *
1028
+ * Automatically prefixes the message with `LOG_SYMBOLS.success` (green ✔).
1029
+ * Always outputs to stderr. If the message starts with an existing
1030
+ * symbol, it will be stripped and replaced.
1031
+ *
1032
+ * @param args - Message and additional arguments to log
1033
+ * @returns The logger instance for chaining
1034
+ *
1035
+ * @example
1036
+ * ```typescript
1037
+ * logger.success('Build completed')
1038
+ * logger.success('Tests passed:', { total: 42, passed: 42 })
1039
+ * logger.success('Deployment successful')
1040
+ * ```
1041
+ */
1042
+ success(...args) {
1043
+ return this.#symbolApply("success", args);
1044
+ }
1045
+ /**
1046
+ * Logs a completion message with a success symbol (alias for `success()`).
1047
+ *
1048
+ * Provides semantic clarity when marking something as "done". Does NOT
1049
+ * automatically clear the current line - call `clearLine()` first if
1050
+ * needed after using `progress()`.
1051
+ *
1052
+ * @param args - Message and additional arguments to log
1053
+ * @returns The logger instance for chaining
1054
+ *
1055
+ * @example
1056
+ * ```typescript
1057
+ * logger.done('Task completed')
1058
+ *
1059
+ * // After progress indicator
1060
+ * logger.progress('Processing...')
1061
+ * // ... do work ...
1062
+ * logger.clearLine()
1063
+ * logger.done('Processing complete')
1064
+ * ```
1065
+ */
1066
+ done(...args) {
1067
+ return this.#symbolApply("success", args);
1068
+ }
1069
+ /**
1070
+ * Displays data in a table format.
1071
+ *
1072
+ * Works like `console.table()`. Accepts arrays of objects or
1073
+ * objects with nested objects. Optionally specify which properties
1074
+ * to include in the table.
1075
+ *
1076
+ * @param tabularData - The data to display as a table
1077
+ * @param properties - Optional array of property names to include
1078
+ * @returns The logger instance for chaining
1079
+ *
1080
+ * @example
1081
+ * ```typescript
1082
+ * // Array of objects
1083
+ * logger.table([
1084
+ * { name: 'Alice', age: 30 },
1085
+ * { name: 'Bob', age: 25 }
1086
+ * ])
1087
+ *
1088
+ * // Specify properties to show
1089
+ * logger.table(users, ['name', 'email'])
1090
+ *
1091
+ * // Object with nested objects
1092
+ * logger.table({
1093
+ * user1: { name: 'Alice', age: 30 },
1094
+ * user2: { name: 'Bob', age: 25 }
1095
+ * })
1096
+ * ```
1097
+ */
1098
+ table(tabularData, properties) {
1099
+ const con = this.#getConsole();
1100
+ con.table(tabularData, properties);
1101
+ this[lastWasBlankSymbol](false);
1102
+ return this[incLogCallCountSymbol]();
1103
+ }
1104
+ /**
1105
+ * Ends a timer and logs the elapsed time.
1106
+ *
1107
+ * Logs the duration since `console.time()` was called with the same
1108
+ * label. The timer is stopped and removed.
1109
+ *
1110
+ * @param label - Optional label for the timer
1111
+ * @default 'default'
1112
+ * @returns The logger instance for chaining
1113
+ *
1114
+ * @example
1115
+ * ```typescript
1116
+ * console.time('operation')
1117
+ * // ... do work ...
1118
+ * logger.timeEnd('operation')
1119
+ * // Logs: "operation: 123.456ms"
1120
+ *
1121
+ * console.time()
1122
+ * // ... do work ...
1123
+ * logger.timeEnd()
1124
+ * // Logs: "default: 123.456ms"
1125
+ * ```
1126
+ */
1127
+ timeEnd(label) {
1128
+ const con = this.#getConsole();
1129
+ con.timeEnd(label);
1130
+ this[lastWasBlankSymbol](false);
1131
+ return this[incLogCallCountSymbol]();
1132
+ }
1133
+ /**
1134
+ * Logs the current value of a timer without stopping it.
1135
+ *
1136
+ * Logs the duration since `console.time()` was called with the same
1137
+ * label, but keeps the timer running. Can include additional data
1138
+ * to log alongside the time.
1139
+ *
1140
+ * @param label - Optional label for the timer
1141
+ * @param data - Additional data to log with the time
1142
+ * @default 'default'
1143
+ * @returns The logger instance for chaining
1144
+ *
1145
+ * @example
1146
+ * ```typescript
1147
+ * console.time('process')
1148
+ * // ... partial work ...
1149
+ * logger.timeLog('process', 'Checkpoint 1')
1150
+ * // Logs: "process: 123.456ms Checkpoint 1"
1151
+ * // ... more work ...
1152
+ * logger.timeLog('process', 'Checkpoint 2')
1153
+ * // Logs: "process: 234.567ms Checkpoint 2"
1154
+ * console.timeEnd('process')
1155
+ * ```
1156
+ */
1157
+ timeLog(label, ...data) {
1158
+ const con = this.#getConsole();
1159
+ con.timeLog(label, ...data);
1160
+ this[lastWasBlankSymbol](false);
1161
+ return this[incLogCallCountSymbol]();
1162
+ }
1163
+ /**
1164
+ * Logs a stack trace to the console.
1165
+ *
1166
+ * Works like `console.trace()`. Shows the call stack leading to
1167
+ * where this method was called. Useful for debugging.
1168
+ *
1169
+ * @param message - Optional message to display with the trace
1170
+ * @param args - Additional arguments to log
1171
+ * @returns The logger instance for chaining
1172
+ *
1173
+ * @example
1174
+ * ```typescript
1175
+ * function debugFunction() {
1176
+ * logger.trace('Debug point reached')
1177
+ * }
1178
+ *
1179
+ * logger.trace('Trace from here')
1180
+ * logger.trace('Error context:', { userId: 123 })
1181
+ * ```
1182
+ */
1183
+ trace(message, ...args) {
1184
+ const con = this.#getConsole();
1185
+ con.trace(message, ...args);
1186
+ this[lastWasBlankSymbol](false);
1187
+ return this[incLogCallCountSymbol]();
1188
+ }
1189
+ /**
1190
+ * Logs a warning message with a yellow colored warning symbol.
1191
+ *
1192
+ * Automatically prefixes the message with `LOG_SYMBOLS.warn` (yellow ⚠).
1193
+ * Always outputs to stderr. If the message starts with an existing
1194
+ * symbol, it will be stripped and replaced.
1195
+ *
1196
+ * @param args - Message and additional arguments to log
1197
+ * @returns The logger instance for chaining
1198
+ *
1199
+ * @example
1200
+ * ```typescript
1201
+ * logger.warn('Deprecated API used')
1202
+ * logger.warn('Low memory:', { available: '100MB' })
1203
+ * logger.warn('Missing optional configuration')
1204
+ * ```
1205
+ */
1206
+ warn(...args) {
1207
+ return this.#symbolApply("warn", args);
1208
+ }
1209
+ /**
1210
+ * Writes text directly to stdout without a newline or indentation.
1211
+ *
1212
+ * Useful for progress indicators or custom formatting where you need
1213
+ * low-level control. Does not apply any indentation or formatting.
1214
+ *
1215
+ * @param text - The text to write
1216
+ * @returns The logger instance for chaining
1217
+ *
1218
+ * @example
1219
+ * ```typescript
1220
+ * logger.write('Processing... ')
1221
+ * // ... do work ...
1222
+ * logger.write('done\n')
1223
+ *
1224
+ * // Build a line incrementally
1225
+ * logger.write('Step 1')
1226
+ * logger.write('... Step 2')
1227
+ * logger.write('... Step 3\n')
1228
+ * ```
1229
+ */
1230
+ write(text) {
1231
+ const con = this.#getConsole();
1232
+ const ctorArgs = privateConstructorArgs.get(this) ?? [];
1233
+ const stdout = this.#originalStdout || ctorArgs[0]?.stdout || con._stdout;
1234
+ stdout.write(text);
1235
+ this[lastWasBlankSymbol](false);
1236
+ return this;
1237
+ }
1238
+ /**
1239
+ * Shows a progress indicator that can be cleared with `clearLine()`.
1240
+ *
1241
+ * Displays a simple status message with a '∴' prefix. Does not include
1242
+ * animation or spinner. Intended to be cleared once the operation completes.
1243
+ * The output stream (stderr or stdout) depends on whether the logger is
1244
+ * stream-bound.
1245
+ *
1246
+ * @param text - The progress message to display
1247
+ * @returns The logger instance for chaining
1248
+ *
1249
+ * @example
1250
+ * ```typescript
1251
+ * logger.progress('Processing files...')
1252
+ * // ... do work ...
1253
+ * logger.clearLine()
1254
+ * logger.success('Files processed')
1255
+ *
1256
+ * // Stream-specific progress
1257
+ * logger.stdout.progress('Loading...')
1258
+ * // ... do work ...
1259
+ * logger.stdout.clearLine()
1260
+ * logger.stdout.log('Done')
1261
+ * ```
1262
+ */
1263
+ progress(text) {
1264
+ const con = this.#getConsole();
1265
+ const stream = this.#getTargetStream();
1266
+ const streamObj = stream === "stderr" ? con._stderr : con._stdout;
1267
+ streamObj.write(`\u2234 ${text}`);
1268
+ this[lastWasBlankSymbol](false);
1269
+ return this;
1270
+ }
1271
+ /**
1272
+ * Clears the current line in the terminal.
1273
+ *
1274
+ * Moves the cursor to the beginning of the line and clears all content.
1275
+ * Works in both TTY and non-TTY environments. Useful for clearing
1276
+ * progress indicators created with `progress()`.
1277
+ *
1278
+ * The stream to clear (stderr or stdout) depends on whether the logger
1279
+ * is stream-bound.
1280
+ *
1281
+ * @returns The logger instance for chaining
1282
+ *
1283
+ * @example
1284
+ * ```typescript
1285
+ * logger.progress('Loading...')
1286
+ * // ... do work ...
1287
+ * logger.clearLine()
1288
+ * logger.success('Loaded')
1289
+ *
1290
+ * // Clear multiple progress updates
1291
+ * for (const file of files) {
1292
+ * logger.progress(`Processing ${file}`)
1293
+ * processFile(file)
1294
+ * logger.clearLine()
1295
+ * }
1296
+ * logger.success('All files processed')
1297
+ * ```
1298
+ */
1299
+ clearLine() {
1300
+ const con = this.#getConsole();
1301
+ const stream = this.#getTargetStream();
1302
+ const streamObj = stream === "stderr" ? con._stderr : con._stdout;
1303
+ if (streamObj.isTTY) {
1304
+ streamObj.cursorTo(0);
1305
+ streamObj.clearLine(0);
1306
+ } else {
1307
+ streamObj.write("\r\x1B[K");
1308
+ }
1309
+ return this;
1310
+ }
1311
+ }
1312
+ let _prototypeInitialized = false;
1313
+ function ensurePrototypeInitialized() {
1314
+ if (_prototypeInitialized) {
1315
+ return;
1316
+ }
1317
+ _prototypeInitialized = true;
1318
+ const entries = [
1319
+ [
1320
+ getKGroupIndentationWidthSymbol(),
1321
+ {
1322
+ ...consolePropAttributes,
1323
+ value: 2
1324
+ }
1325
+ ],
1326
+ [
1327
+ Symbol.toStringTag,
1328
+ {
1329
+ __proto__: null,
1330
+ configurable: true,
1331
+ value: "logger"
1332
+ }
1333
+ ]
1334
+ ];
1335
+ for (const { 0: key, 1: value } of Object.entries(globalConsole)) {
1336
+ if (!Logger.prototype[key] && typeof value === "function") {
1337
+ const { [key]: func } = {
1338
+ [key](...args) {
1339
+ let con = privateConsole.get(this);
1340
+ if (con === void 0) {
1341
+ const ctorArgs = privateConstructorArgs.get(this) ?? [];
1342
+ privateConstructorArgs.delete(this);
1343
+ if (ctorArgs.length) {
1344
+ con = /* @__PURE__ */ constructConsole(...ctorArgs);
1345
+ } else {
1346
+ con = /* @__PURE__ */ constructConsole({
1347
+ stdout: process.stdout,
1348
+ stderr: process.stderr
1349
+ });
1350
+ for (const { 0: k, 1: method } of boundConsoleEntries) {
1351
+ con[k] = method;
1352
+ }
1353
+ }
1354
+ privateConsole.set(this, con);
1355
+ }
1356
+ const result = con[key](...args);
1357
+ return result === void 0 || result === con ? this : result;
1358
+ }
1359
+ };
1360
+ entries.push([
1361
+ key,
1362
+ {
1363
+ ...consolePropAttributes,
1364
+ value: func
1365
+ }
1366
+ ]);
1367
+ }
1368
+ }
1369
+ Object.defineProperties(Logger.prototype, Object.fromEntries(entries));
1370
+ }
1371
+ let _logger;
1372
+ function getDefaultLogger() {
1373
+ if (_logger === void 0) {
1374
+ _logger = new Logger();
1375
+ }
1376
+ return _logger;
1377
+ }
1378
+ // Annotate the CommonJS export names for ESM import in node:
1379
+ 0 && (module.exports = {
1380
+ LOG_SYMBOLS,
1381
+ Logger,
1382
+ getDefaultLogger,
1383
+ incLogCallCountSymbol,
1384
+ lastWasBlankSymbol
1385
+ });
3
1386
  //# sourceMappingURL=logger.js.map