@analog-tools/logger
Version:
Logging utility for AnalogJS applications
3 lines (2 loc) • 19.9 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(s=>(s.SkyBlue="\x1B[94m",s.OceanBlue="\x1B[34m",s.MidnightBlue="\x1B[38;5;17m",s.SkyBlueBg="\x1B[104m",s.OceanBlueBg="\x1B[44m",s.MidnightBlueBg="\x1B[48;5;17m",s.MintGreen="\x1B[92m",s.ForestGreen="\x1B[32m",s.EmeraldGreen="\x1B[38;5;28m",s.MintGreenBg="\x1B[102m",s.ForestGreenBg="\x1B[42m",s.EmeraldGreenBg="\x1B[48;5;28m",s.LemonYellow="\x1B[93m",s.SunflowerYellow="\x1B[33m",s.GoldYellow="\x1B[38;5;220m",s.LemonYellowBg="\x1B[103m",s.SunflowerYellowBg="\x1B[43m",s.GoldYellowBg="\x1B[48;5;220m",s.RoseRed="\x1B[91m",s.FireRed="\x1B[31m",s.BurgundyRed="\x1B[38;5;88m",s.RoseRedBg="\x1B[101m",s.FireRedBg="\x1B[41m",s.BurgundyRedBg="\x1B[48;5;88m",s.LavenderPurple="\x1B[95m",s.RoyalPurple="\x1B[38;5;93m",s.DeepPurple="\x1B[38;5;54m",s.LavenderPurpleBg="\x1B[105m",s.RoyalPurpleBg="\x1B[48;5;93m",s.DeepPurpleBg="\x1B[48;5;54m",s.PeachOrange="\x1B[38;5;215m",s.TangerineOrange="\x1B[38;5;208m",s.AmberOrange="\x1B[38;5;214m",s.PeachOrangeBg="\x1B[48;5;215m",s.TangerineOrangeBg="\x1B[48;5;208m",s.AmberOrangeBg="\x1B[48;5;214m",s.SilverGray="\x1B[37m",s.SlateGray="\x1B[90m",s.CharcoalGray="\x1B[38;5;238m",s.SilverGrayBg="\x1B[47m",s.SlateGrayBg="\x1B[100m",s.CharcoalGrayBg="\x1B[48;5;238m",s.PureBlack="\x1B[30m",s.PureWhite="\x1B[97m",s.PureBlackBg="\x1B[40m",s.PureWhiteBg="\x1B[107m",s.Cyan="\x1B[36m",s.Reset="\x1B[0m",s.Bold="\x1B[1m",s.Dim="\x1B[2m",s.Underline="\x1B[4m",s.Blink="\x1B[5m",s.Reverse="\x1B[7m",s.Hidden="\x1B[8m",s))(l||{}),o=(s=>(s[s.trace=0]="trace",s[s.debug=1]="debug",s[s.info=2]="info",s[s.warn=3]="warn",s[s.error=4]="error",s[s.fatal=5]="fatal",s[s.silent=6]="silent",s))(o||{});function M(s){return["trace","debug","info","warn","error","fatal","silent"].includes(s)}const u=class u{static getCacheKey(e,t,i,r){if(!e.stack)return null;const a=e.stack.split(`
`)[0]||"";return`${e.name}:${e.message}:${a}:${t}:${i}:${r}`}static addToCache(e,t){if(this.serializationCache.size>=this.MAX_CACHE_SIZE){const i=this.serializationCache.keys().next().value;i&&this.serializationCache.delete(i)}this.serializationCache.set(e,t)}static serialize(e,t={}){const{includeStack:i=!0,maxDepth:r=u.DEFAULT_MAX_DEPTH,includeNonEnumerable:a=!1}=t;if(e instanceof Error){const c=this.getCacheKey(e,i,r,a);if(c){const d=this.serializationCache.get(c);if(d)return d}const h=this.serializeError(e,i,r,a,new WeakSet);return c&&this.addToCache(c,h),h}if(typeof e=="string")return e;const n=this.safeStringify(e,r,new WeakSet);if(typeof n=="string")return n;try{return JSON.stringify(n,null,2)}catch{return String(n)}}static serializeError(e,t,i,r,a=new WeakSet){if(a.has(e))return{message:e.message,name:e.name,[Symbol.for("circular")]:this.CIRCULAR_REF_PLACEHOLDER};a.add(e);const n={message:e.message,name:e.name};return t&&e.stack&&(n.stack=e.stack),"cause"in e&&e.cause!==void 0&&(e.cause instanceof Error?n.cause=this.serializeError(e.cause,t,i-1,r,a):n.cause=this.safeStringify(e.cause,i-1,a)),Object.keys(e).forEach(c=>{if(!(c in n))try{const h=e;n[c]=this.safeStringify(h[c],i-1,a)}catch{n[c]=this.UNABLE_TO_SERIALIZE}}),r&&Object.getOwnPropertyNames(e).forEach(c=>{if(!(c in n)&&c!=="stack"&&c!=="message"&&c!=="name")try{const h=Object.getOwnPropertyDescriptor(e,c);if(h&&h.enumerable===!1){const d=e;n[c]=this.safeStringify(d[c],i-1,a)}}catch{n[c]=this.UNABLE_TO_SERIALIZE}}),n}static safeStringify(e,t,i=new WeakSet){if(t<=0)return this.MAX_DEPTH_PLACEHOLDER;if(e===null||typeof e!="object")return e;if(i.has(e))return this.CIRCULAR_REF_PLACEHOLDER;i.add(e);try{if(Array.isArray(e)){const a=e.map(n=>this.safeStringify(n,t-1,i));return i.delete(e),a}const r={};for(const[a,n]of Object.entries(e))try{r[a]=this.safeStringify(n,t-1,i)}catch{r[a]=this.UNABLE_TO_SERIALIZE}return i.delete(e),r}catch{return i.delete(e),this.UNABLE_TO_SERIALIZE}}};u.DEFAULT_MAX_DEPTH=10,u.CIRCULAR_REF_PLACEHOLDER="[Circular Reference]",u.MAX_DEPTH_PLACEHOLDER="[Max Depth Reached]",u.UNABLE_TO_SERIALIZE="[Unable to serialize]",u.serializationCache=new Map,u.MAX_CACHE_SIZE=100;let m=u;const E={highlight:{color:l.LemonYellow,bold:!0},accent:{color:l.SkyBlue},attention:{color:l.RoyalPurple,bold:!0},success:{color:l.ForestGreen},warning:{color:l.TangerineOrange},error:{color:l.FireRed},info:{color:l.OceanBlue},debug:{color:l.SlateGray}},A={success:"✅",warning:"⚠️",error:"❌",info:"ℹ️",debug:"🐞"},D={trace:l.SlateGray,debug:l.Cyan,info:l.ForestGreen,warn:l.SunflowerYellow,error:l.FireRed,fatal:l.FireRed,silent:l.Reset},x=class x{constructor(e={}){this.styleCache=new Map;const t=process.env.NODE_ENV==="test"||process.env.VITEST==="true";this.useColors=e.useColors!==void 0?e.useColors:!t,this.globalStyles={...E,...e.styles},this.globalIcons={...A,...e.icons}}resolveStyle(e,t="test",i){return this.applyStyle(e,t,i)}setUseColors(e){this.useColors=e}getUseColors(){return this.useColors}updateStyleConfig(e,t){this.globalStyles={...this.globalStyles,...e},this.globalIcons={...this.globalIcons,...t}}formatMessage(e,t,i,r,a){const n=r?`[${i}:${r}]`:`[${i}]`;if(this.useColors){let c=this.getColorForLevel(e);return a&&(c=a),`${c}${n} ${t}${l.Reset}`}else return`${n} ${t}`}formatMessageWithMetadata(e,t,i,r,a){let n=t,c=this.getColorForLevel(e);if(r!=null&&r.style){const h=this.applyStyle(r.style,i,a);h&&(c=h)}return r!=null&&r.icon&&(n=`${this.resolveIcon(r.icon,i,a)} ${t}`),this.formatMessage(e,n,i,a,c)}parseMetadataParameter(e,t=[]){if(e&&typeof e=="object"&&!Array.isArray(e)&&("style"in e||"icon"in e))return{metadata:e,restData:t};const i=e!==void 0?[e,...t]:t;if(i.length>0){const r=i[i.length-1];if(r&&typeof r=="object"&&!Array.isArray(r)&&("style"in r||"icon"in r))return{metadata:r,restData:i.slice(0,-1)}}return{metadata:void 0,restData:i}}getColorForLevel(e){const t=o[e],i=D[t];return e===o.fatal?`${l.Bold}${i}`:i||l.Reset}applyStyle(e,t,i){const r=this.getStyleCacheValue(e);if(r!==void 0)return r;if(typeof e=="string"){const a=this.getSemanticStyleColor(e,t,i);return this.setStyleCache(e,a),a}if(typeof e=="object"&&"color"in e){if(!this.isValidColor(e.color)){this.setStyleCache(e,void 0),this.logWarning("Invalid color provided. Only predefined ColorEnum values are allowed.",t,i);return}const a=this.constructStyleCode(e);return this.setStyleCache(e,a),a}this.setStyleCache(e,void 0),this.logWarning("Unknown style configuration provided. Only semantic style names or valid ColorEnum objects are allowed.",t,i)}isValidColor(e){return Object.values(l).includes(e)}isValidIcon(e){return this.isEmojiIcon(e)}getStyleCacheValue(e){return this.styleCache.has(e)?this.styleCache.get(e):void 0}setStyleCache(e,t){this.styleCache.set(e,t)}logWarning(e,t,i){const r=i?`${t}:${i}`:t;console.warn(`[${r}] ${e}`)}constructStyleCode(e){let t=e.color.toString();return e.bold&&(t+=l.Bold),e.underline&&(t+=l.Underline),t}getSemanticStyleColor(e,t,i){if(this.styleCache.has(e))return this.styleCache.get(e);const r=this.globalStyles[e];if(r){let n=r.color.toString();return r.bold&&(n+=l.Bold),r.underline&&(n+=l.Underline),this.styleCache.set(e,n),n}const a=i?`${t}:${i}`:t;console.warn(`[${a}] Unknown semantic style: ${e}. Falling back to default.`),this.styleCache.set(e,void 0)}getStyleCache(){return this.styleCache}resolveIcon(e,t,i){if(this.isValidIcon(e))return e;const r=["success","warning","error","info","debug"],a=r.find(n=>n===e);return a&&this.globalIcons[a]?this.globalIcons[a]:(r.includes(e)?this.logWarning(`Unknown icon: ${e}. Expected a valid emoji or semantic icon name.`,t,i):this.logWarning(`Invalid icon: ${e}. Expected a valid emoji or semantic icon name.`,t,i),e)}isEmojiIcon(e){return["✅","⚠️","❌","ℹ️","🐞","⭐️","🚀","🔥","✔️","✖️","❓","🔒","🔓","⏳","🕒","⬆️","⬇️","➡️","⬅️","📁","📄","👤","👥","✏️","➕","➖","🔔","⚡️","🎁","🐛","🌟","❤️","👀","⚙️","🔧","🔨","🔑","🎉","📝","🚨","📅","💡","🔍","🔗","🔖","📌","📎","✉️","📞","🌍","☁️","🌈","🌙","☀️","❄️","✨","🎵","📷","🎥","🎤","🔊","🔋","🗑️","💰","💳","🎂","🏅","🏆","👑","🛸","🛡️","🛑","▶️","⏸️","⏺️","⏪","⏩","🔁","🔀","🎲","🎈","🍪","☕️","🍵","🍺","🍷","🍕","🍔","🍟","🍎","🍌","🍒","🍋","🥕","🌽","🥦","🥚","🧀","🍞","🍰","🍦","🍫","🍿","🥓","🍤","🐟","🦀","🐙","🐋","🐬","🐧","🐸","🐢","🐍","🐉","🦄","🐱","🐶","🐭","🐰","🐻","🐼","🐨","🐯","🦁","🐒","🐘","🐎","🐄","🐖","🐑","🐔","🦆","🦢","🦉","🦅","🦜","🦚","🦩","🦋","🐝","🐜","🐞","🕷️","🦂","🐌","🪱","🐛","🦗","🦟","🪰","🪳","🪲"].includes(e)}};x.INJECTABLE=!0;let v=x;class B extends Error{constructor(e){super(e),this.name="LoggerError"}}class F extends Error{constructor(e){super(e),this.name="LoggerContextError"}}const S={enabled:!1,windowMs:5e3,flushOnCritical:!0},C=[o.error,o.fatal];class R{constructor(e,t){this.config=e,this.formatMessage=t,this.entries=new Map}addMessage(e,t,i=""){if(!this.config.enabled||this.config.flushOnCritical&&C.includes(e))return!0;const r=this.generateFingerprint(t,e,i),a=this.entries.get(r);return a?a.count++:this.entries.set(r,{message:t,level:e,context:i,firstSeen:Date.now(),count:1}),this.scheduleFlush(),!1}flush(){if(this.entries.size!==0){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);for(const e of this.entries.values())this.outputMessage(e);this.entries.clear()}}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),this.entries.clear()}generateFingerprint(e,t,i){return`${t}:${i}:${e}`}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},this.config.windowMs))}outputMessage(e){let t=e.message;e.count>1&&(t=`${t} (×${e.count})`);const i=this.formatMessage(e.level,t,e.context);switch(e.level){case o.trace:console.trace(i);break;case o.debug:console.debug(i);break;case o.info:console.info(i);break;case o.warn:console.warn(i);break;case o.error:console.error(i);break;case o.fatal:console.error(i);break}}}const L=class L{constructor(e={},t,i,r){var a,n;if(this.config=e,this.childLoggers={},this.disabledContexts=[],this.activeGroups=[],r)this.parentLogger=r,this.name=r.name,this.context=i,this.logLevel=r.getLogLevel(),this.styleEngine=r.styleEngine;else{if(typeof e.level=="string"&&!Object.keys(o).includes(e.level))throw new B(`Invalid log level: ${e.level}`);if(this.logLevel=this.castLoglevel(e.level||process.env.LOG_LEVEL||"info"),this.name=e.name||"analog-tools",this.setDisabledContexts(e.disabledContexts??((a=process.env.LOG_DISABLED_CONTEXTS)==null?void 0:a.split(","))??[]),this.styleEngine=t||new v({useColors:e.useColors,styles:{...E,...e.styles},icons:{...A,...e.icons}}),(n=e.deduplication)!=null&&n.enabled){const c={enabled:!0,windowMs:e.deduplication.windowMs??S.windowMs,flushOnCritical:e.deduplication.flushOnCritical??S.flushOnCritical},h=(d,p,g)=>this.styleEngine.formatMessage(d,p,this.name,g);this.deduplicator=new R(c,h)}}}isContextEnabled(){return this.context?!(this.parentLogger||this).disabledContexts.includes(this.context):!0}setDisabledContexts(e){this.disabledContexts=e}getLogLevel(){return this.logLevel}getDisabledContexts(){return(this.parentLogger||this).disabledContexts||[]}setUseColors(e){(this.parentLogger||this).styleEngine.setUseColors(e)}getUseColors(){return(this.parentLogger||this).styleEngine.getUseColors()}forContext(e){return this.childLoggers[e]||(this.childLoggers[e]=new L({},void 0,e,this)),this.childLoggers[e]}group(e){var r;if(!this.isContextEnabled())return;(((r=this.parentLogger)==null?void 0:r.activeGroups)||this.activeGroups).push(e);const i=this.styleEngine.formatMessage(o.info,`Group: ${e}`,this.name,this.context);console.group(`${i} ▼`)}groupEnd(e){var i;if(!this.isContextEnabled())return;const t=((i=this.parentLogger)==null?void 0:i.activeGroups)||this.activeGroups;if(e){const r=t.lastIndexOf(e);if(r!==-1){const a=t.splice(r);for(let n=0;n<a.length;n++)console.groupEnd(),console.log("")}}else t.length>0&&(t.pop(),console.groupEnd(),console.log(""))}trace(e,t,...i){if(!this.isContextEnabled()||this.logLevel>o.trace)return;const{metadata:r,restData:a}=this.styleEngine.parseMetadataParameter(t,i);if(this.handleDeduplication(o.trace,e,r,a))if(r){const n=this.styleEngine.formatMessageWithMetadata(o.trace,e,this.name,r,this.context);console.trace(n,...a||[])}else{const n=this.styleEngine.formatMessage(o.trace,e,this.name,this.context);console.trace(n,...a||[])}}debug(e,t,...i){if(!this.isContextEnabled()||this.logLevel>o.debug)return;const{metadata:r,restData:a}=this.styleEngine.parseMetadataParameter(t,i);if(this.handleDeduplication(o.debug,e,r,a))if(r){const n=this.styleEngine.formatMessageWithMetadata(o.debug,e,this.name,r,this.context);console.debug(n,...a||[])}else{const n=this.styleEngine.formatMessage(o.debug,e,this.name,this.context);console.debug(n,...a||[])}}info(e,t,...i){if(!this.isContextEnabled()||this.logLevel>o.info)return;const{metadata:r,restData:a}=this.styleEngine.parseMetadataParameter(t,i);if(this.handleDeduplication(o.info,e,r,a))if(r){const n=this.styleEngine.formatMessageWithMetadata(o.info,e,this.name,r,this.context);console.info(n,...a||[])}else{const n=this.styleEngine.formatMessage(o.info,e,this.name,this.context);console.info(n,...a||[])}}warn(e,t,...i){if(!this.isContextEnabled()||this.logLevel>o.warn)return;const{metadata:r,restData:a}=this.styleEngine.parseMetadataParameter(t,i);if(this.handleDeduplication(o.warn,e,r,a))if(r){const n=this.styleEngine.formatMessageWithMetadata(o.warn,e,this.name,r,this.context);console.warn(n,...a||[])}else{const n=this.styleEngine.formatMessage(o.warn,e,this.name,this.context);console.warn(n,...a||[])}}error(e,t,i,...r){if(!this.isContextEnabled()||this.logLevel>o.error)return;const{message:a,serializedError:n,context:c,data:h}=this.parseErrorParameters(e,t,i,r),d=h||[];let p,g=d;if(d.length>0){const f=d[d.length-1];f&&typeof f=="object"&&!Array.isArray(f)&&("style"in f||"icon"in f)&&(p=f,g=d.slice(0,-1))}const y=[this.styleEngine.formatMessageWithMetadata(o.error,a,this.name,p,this.context)];n&&y.push(n),c&&y.push(c),console.error(...y,...g)}fatal(e,t,i,...r){if(!this.isContextEnabled()||this.logLevel>o.fatal)return;if(typeof e=="string"&&t&&typeof t=="object"&&!Array.isArray(t)&&("style"in t||"icon"in t)){const f=t,P=this.styleEngine.formatMessageWithMetadata(o.fatal,`FATAL: ${e}`,this.name,f,this.context);console.error(P);return}const{message:a,serializedError:n,context:c,data:h}=this.parseErrorParameters(e,t,i,r),d=h||[];let p,g=d;if(d.length>0){const f=d[d.length-1];f&&typeof f=="object"&&!Array.isArray(f)&&("style"in f||"icon"in f)&&(p=f,g=d.slice(0,-1))}const y=[this.styleEngine.formatMessageWithMetadata(o.fatal,`FATAL: ${a}`,this.name,p,this.context)];n&&y.push(n),c&&y.push(c),console.error(...y,...g)}parseErrorParameters(e,t,i,r=[]){if(e instanceof Error&&t===void 0)return{message:e.message,serializedError:m.serialize(e),data:[]};if(typeof e=="string"&&t===void 0)return{message:e,data:[]};if(typeof e=="string"&&t instanceof Error&&i===void 0)return{message:e,serializedError:m.serialize(t),data:[]};if(typeof e=="string"&&this.isLogContext(t)&&i===void 0)return{message:e,context:t,data:[]};if(typeof e=="string"&&t instanceof Error&&this.isLogContext(i))return{message:e,serializedError:m.serialize(t),context:i,data:r};const a=typeof e=="string"?e:"Unknown error",n=t?m.serialize(t):void 0,c=i!==void 0?[i,...r]:r;return{message:a,serializedError:n,data:c}}isLogContext(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Error)&&!(e instanceof Date)&&!(e instanceof RegExp)&&typeof e!="function"}castLoglevel(e){if(M(e))switch(e){case"trace":return o.trace;case"debug":return o.debug;case"info":return o.info;case"warn":return o.warn;case"error":return o.error;case"fatal":return o.fatal;case"silent":return o.silent}const t=e.toLowerCase();throw M(t)?new B(`Invalid log level: ${e}. Log levels are case-sensitive. Valid levels: trace, debug, info, warn, error, fatal, silent.`):new B(`Invalid log level: ${e}. Valid levels: trace, debug, info, warn, error, fatal, silent.`)}safeFormatMessage(e,t,i,r="",a=""){try{return this.styleEngine.formatMessage(e,t,i,r,a)}catch(n){throw this.error("Style engine failure",n),new B("Style engine failure")}}shouldLogImmediately(e,t){const r=(this.parentLogger||this).deduplicator;if(!r)return!0;try{return r.addMessage(e,t,this.context)}catch(a){return console.error("Logger deduplication error:",a),!0}}handleDeduplication(e,t,i,r){return!i&&r.length===0?this.shouldLogImmediately(e,t):!0}};L.INJECTABLE=!0;let w=L;function _(s){if(typeof s=="function")return s.__is_handler__=!0,s;const e={onRequest:I(s.onRequest),onBeforeResponse:I(s.onBeforeResponse)},t=i=>U(i,s.handler,e);return t.__is_handler__=!0,t.__resolve__=s.handler.__resolve__,t.__websocket__=s.websocket,t}function I(s){return s?Array.isArray(s)?s:[s]:void 0}async function U(s,e,t){if(t.onRequest){for(const a of t.onRequest)if(await a(s),s.handled)return}const r={body:await e(s)};if(t.onBeforeResponse)for(const a of t.onBeforeResponse)await a(s,r);return r.body}let b=null;function j(){return b||(b=new G),b}class G{constructor(){this.serviceMap=new Map}register(e,...t){if(this.isServiceInjectable(e)&&(!this.hasService(e)||this.getService(e)===void 0)){if(t===void 0||t.length===0){this.serviceMap.set(this.getInjcectableName(e),new e);return}this.serviceMap.set(this.getInjcectableName(e),new e(...t))}}registerAsUndefined(e){if(this.isServiceInjectable(e))this.serviceMap.set(this.getInjcectableName(e),void 0);else throw new Error(`Service with token ${this.getInjcectableName(e)} is not injectable. Ensure it has the INJECTABLE static property set to true.`)}registerCustomServiceInstance(e,t){if(this.isServiceInjectable(e))this.serviceMap.set(this.getInjcectableName(e),t);else throw new Error(`Service with token ${this.getInjcectableName(e)} is not injectable. Ensure it has the INJECTABLE static property set to true.`)}getService(e){if(this.isServiceInjectable(e))return this.hasService(e)||this.register(e),this.serviceMap.get(this.getInjcectableName(e))}hasService(e){return this.serviceMap.has(this.getInjcectableName(e))}isServiceInjectable(e){const t=e.INJECTABLE;return t!==void 0&&t!==!1}getInjcectableName(e){if(this.isServiceInjectable(e)){const t=e.INJECTABLE;return typeof t!="string"?e.name:t}throw new Error(`Service with token ${e.name} is not injectable. Ensure it has the INJECTABLE static property set to true.`)}destroy(){this.serviceMap.clear()}}function W(s,e,t={}){const{required:i=!0}=t,r=s.getService(e);if(!r&&i)throw new Error(`Service with token ${e||"unknown"} not found in registry`);return r}function T(s,e={}){return W(j(),s,e)}function z(s="api"){return _(e=>{const t=T(w).forContext(s);e.context.logger=t,t.debug("Request received",{method:e.method,path:e.path,requestId:e.context.id})})}function H(s,e={}){const{namespace:t="api",level:i="debug",logResponse:r=!1}=e;return _(async a=>{const n=T(w).forContext(t),c=Date.now();try{const h=await s(a),d=Date.now()-c,g={trace:"trace",debug:"debug",info:"info",warn:"warn",error:"error",fatal:"fatal",silent:void 0}[i];return g&&typeof n[g]=="function"&&n[g](`Request completed in ${d}ms`,{method:a.method,path:a.path,duration:d,...r&&h?{response:h}:{}}),h}catch(h){const d=Date.now()-c;throw n.error(`Request failed after ${d}ms`,h,{method:a.method,path:a.path,duration:d}),h}})}exports.CRITICAL_LEVELS=C;exports.ColorEnum=l;exports.DEFAULT_DEDUPLICATION_CONFIG=S;exports.ErrorSerializer=m;exports.LogDeduplicator=R;exports.LogLevelEnum=o;exports.LoggerContextError=F;exports.LoggerError=B;exports.LoggerService=w;exports.LoggerStyleEngine=v;exports.createLoggerMiddleware=z;exports.isValidLogLevel=M;exports.withLogging=H;