export class Logger {
#groups: Record<string, boolean> = {}
#isEnabled: boolean = false
+ #locale: string = Intl.DateTimeFormat().resolvedOptions().locale ?? 'en-US'
+ #localeOptions: Intl.DateTimeFormatOptions = {
+ hour12: false,
+ dateStyle: 'medium',
+ timeStyle: 'medium'
+ }
#noop (...args: any[]): void { }
#groupStart (name: string): void {
}
#log (...args: any[]): void {
- const datetime = new Date(Date.now()).toLocaleString(Intl.DateTimeFormat().resolvedOptions().locale ?? 'en-US', { hour12: false, dateStyle: 'medium', timeStyle: 'medium' })
+ const datetime = new Date(Date.now()).toLocaleString(this.#locale, this.#localeOptions)
for (let i = 0; i < args.length; i++) {
if (typeof args[i] === 'string') {
args[i] = args[i].replace(datetime, '').trimStart()