mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
refactor: consolidate environment config and API handling
- Update database paths and port configuration - Remove backend config.ts and sessions route - Add mobile file preview and files API - Clean up shared constants and provider hooks
This commit is contained in:
1 parent
0db354048d
commit
8a56bc208d
32 files changed
+301
-512
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { ENV } from '../config'
|
||||
|
||||
type LogLevel = 'info' | 'warn' | 'error' | 'debug'
|
||||
|
||||
class Logger {
|
||||
@@ -7,7 +9,7 @@ class Logger {
|
||||
this.prefix = prefix
|
||||
}
|
||||
|
||||
private format(level: LogLevel, message: string, ...args: unknown[]): string {
|
||||
private format(level: LogLevel, message: string): string {
|
||||
const timestamp = new Date().toISOString()
|
||||
const prefixStr = this.prefix ? `[${this.prefix}] ` : ''
|
||||
return `[${timestamp}] [${level.toUpperCase()}] ${prefixStr}${message}`
|
||||
@@ -26,7 +28,7 @@ class Logger {
|
||||
}
|
||||
|
||||
debug(message: string, ...args: unknown[]): void {
|
||||
if (process.env.DEBUG) {
|
||||
if (ENV.LOGGING.DEBUG) {
|
||||
console.debug(this.format('debug', message), ...args)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user