@bracketed/logger
Version:
An alternative to your run-of-the-mill node console logging functions!
2 lines • 664 B
JavaScript
import {a}from'../chunk-QWPVIX2T.mjs';import {LoggerStyle}from'../Style/Style.mjs';import {Timestamp}from'../Timestamper/Timestamp.mjs';var e=class{static{a(this,"LoggerTimestamp");}timestamp;utc;color;formatter;constructor(t={}){this.timestamp=new Timestamp(t.pattern??"YYYY-MM-DD HH:mm:ss"),this.utc=t.utc??false,this.color=t.color===null?null:new LoggerStyle(t.color),this.formatter=t.formatter??(r=>`${r} - `);}run(){let t=new Date,r=this.utc?this.timestamp.displayUTC(t):this.timestamp.display(t);return this.formatter(this.color?this.color.run(r):r)}};export{e as LoggerTimestamp};//# sourceMappingURL=Timestamp.mjs.map
//# sourceMappingURL=Timestamp.mjs.map