feat: improve initial load performance on mobile (#2126)
This commit is contained in:
22
packages/snjs/lib/Logging.ts
Normal file
22
packages/snjs/lib/Logging.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { log as utilsLog } from '@standardnotes/utils'
|
||||
|
||||
export const isDev = true
|
||||
|
||||
export enum LoggingDomain {
|
||||
DatabaseLoad,
|
||||
Sync,
|
||||
}
|
||||
|
||||
const LoggingStatus: Record<LoggingDomain, boolean> = {
|
||||
[LoggingDomain.DatabaseLoad]: false,
|
||||
[LoggingDomain.Sync]: false,
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function log(domain: LoggingDomain, ...args: any[]): void {
|
||||
if (!isDev || !LoggingStatus[domain]) {
|
||||
return
|
||||
}
|
||||
|
||||
utilsLog(LoggingDomain[domain], ...args)
|
||||
}
|
||||
Reference in New Issue
Block a user