Skip to content

fix(launcher): show log init errors in GUI mode (#1734)#1741

Open
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/1734-log-error-gui
Open

fix(launcher): show log init errors in GUI mode (#1734)#1741
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:fix/1734-log-error-gui

Conversation

@darrenzeng2025
Copy link
Contributor

Description

This PR fixes issue #1734 where log file initialization errors are not visible when running the launcher in GUI mode.

Problem

When the launcher with GUI cannot open the log file (e.g., due to permission issues), it would exit with error code 1 but show no output to the user. This is because:

  1. In GUI mode, console logging is disabled (set to FATAL level)
  2. The error was being written to stderr, which may not be visible in GUI mode

Solution

Before logging the error and exiting, re-enable console logging to INFO level so the error message is visible to users.

Changes

  • Re-enable console logging when log file initialization fails
  • Provide a more helpful error message including the log file path
  • Add a suggestion to check directory permissions

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

AI Code Generation

  • 🤖 Fully AI-generated

Related Issue

Fixes #1734

Test Environment

  • PicoClaw Version: main branch
  • Go Version: 1.25.7

Checklist

  • I have read and understood the Contributing Guide
  • My code follows the project's code style
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have linked the related issue

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 sipeed#1734
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] when launcher with gui not success open log file, crash with no output

1 participant