fix(launcher): show log init errors in GUI mode
When the launcher fails to initialize the log file in GUI mode (non-console), the error message was being written to stderr which is not visible to users. This fix re-enables console logging before logging the error, ensuring that users can see the error message even in GUI mode. Fixes #1734
This commit is contained in:
parent
a1e8ee56f0
commit
93e027a022
1 changed files with 4 additions and 1 deletions
|
|
@ -81,7 +81,10 @@ func main() {
|
|||
|
||||
logPath := filepath.Join(picoHome, "logs", "web.log")
|
||||
if err := logger.EnableFileLogging(logPath); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to initialize logger: %v\n", err)
|
||||
// Re-enable console logging so the error is visible in GUI mode
|
||||
logger.SetConsoleLevel(logger.INFO)
|
||||
logger.Errorf("Failed to initialize log file at %s: %v", logPath, err)
|
||||
logger.Error("Please check that the logs directory is writable")
|
||||
os.Exit(1)
|
||||
}
|
||||
defer logger.DisableFileLogging()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue