feat: download and preview files from local backups automatically, if a local backup is available (#2076)
This commit is contained in:
30
packages/files/src/Domain/Logging.ts
Normal file
30
packages/files/src/Domain/Logging.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { logWithColor } from '@standardnotes/utils'
|
||||
|
||||
declare const process: {
|
||||
env: {
|
||||
NODE_ENV: string | null | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test'
|
||||
|
||||
export enum LoggingDomain {
|
||||
FilesPackage,
|
||||
}
|
||||
|
||||
const LoggingStatus: Record<LoggingDomain, boolean> = {
|
||||
[LoggingDomain.FilesPackage]: false,
|
||||
}
|
||||
|
||||
const DomainColor: Record<LoggingDomain, string> = {
|
||||
[LoggingDomain.FilesPackage]: 'green',
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function log(domain: LoggingDomain, ...args: any[]): void {
|
||||
if (!isDev || !LoggingStatus[domain]) {
|
||||
return
|
||||
}
|
||||
|
||||
logWithColor(LoggingDomain[domain], DomainColor[domain], ...args)
|
||||
}
|
||||
Reference in New Issue
Block a user