Skip to content

Commit 18a37e7

Browse files
committed
chore: wip
1 parent 09a4851 commit 18a37e7

File tree

6 files changed

+613
-1444
lines changed

6 files changed

+613
-1444
lines changed

src/cli/handler.ts

+15-5
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,26 @@ export async function handleLog(logger: Logger, message: string, options: LogOpt
7676
// Ensure all writes are flushed to disk
7777
await targetLogger.flushPendingWrites()
7878

79-
// Verify the log file exists and has content
79+
// Get the current log file path
8080
const logFile = targetLogger.getCurrentLogFilePath()
8181
console.error('Debug: Verifying log file:', logFile)
8282

83+
// Wait a short time to ensure file system has caught up
84+
await new Promise(resolve => setTimeout(resolve, 100))
85+
86+
// Verify the log file exists and has content
8387
const { stat } = await import('node:fs/promises')
84-
const stats = await stat(logFile)
85-
console.error('Debug: Log file stats:', { size: stats.size, path: logFile })
88+
try {
89+
const stats = await stat(logFile)
90+
console.error('Debug: Log file stats:', { size: stats.size, path: logFile })
8691

87-
if (stats.size === 0) {
88-
throw new Error('Log file exists but is empty after write')
92+
if (stats.size === 0) {
93+
throw new Error('Log file exists but is empty after write')
94+
}
95+
}
96+
catch (err) {
97+
console.error('Debug: Error verifying log file:', err)
98+
throw new Error(`Failed to verify log file at ${logFile}: ${err}`)
8999
}
90100

91101
console.error('Debug: Log operation completed successfully')

src/colors.ts

-19
This file was deleted.

src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from './colors'
21
export * from './config'
32
export * from './format'
43
export * from './logger'

0 commit comments

Comments
 (0)