log to file
This commit is contained in:
@@ -70,7 +70,7 @@ func runGameIntegrated(parentWindow fyne.Window, shellCmd string) error {
|
||||
scanner := bufio.NewScanner(stdout)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
log.Debugf("GAME STDOUT: %s", line)
|
||||
log.WineLoggerStdout(line)
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -78,7 +78,7 @@ func runGameIntegrated(parentWindow fyne.Window, shellCmd string) error {
|
||||
scanner := bufio.NewScanner(stderr)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
log.Debugf("GAME STDERR: %s", line)
|
||||
log.WineLoggerStderr(line)
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -200,29 +200,12 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
utils.QuotePathForShell(wineloader2Path),
|
||||
utils.QuotePathForShell(wowExePath))
|
||||
|
||||
// Check user preference for terminal display
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
|
||||
if prefs.ShowTerminalNormally {
|
||||
// Use the old method with external Terminal.app
|
||||
escapedShellCmd := utils.EscapeStringForAppleScript(shellCmd)
|
||||
cmd2Script := fmt.Sprintf("tell application \"Terminal\" to do script \"%s\"", escapedShellCmd)
|
||||
|
||||
log.Debug("Executing WoW launch command via AppleScript...")
|
||||
if !utils.RunOsascript(cmd2Script, myWindow) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug("Launch command executed. Check the new terminal window.")
|
||||
} else {
|
||||
// Use integrated terminal
|
||||
log.Debugf("Shell command for integrated terminal: %s", shellCmd)
|
||||
log.Debug("Executing WoW launch command with integrated terminal...")
|
||||
if err := runGameIntegrated(myWindow, shellCmd); err != nil {
|
||||
dialog.ShowError(fmt.Errorf("failed to launch game: %v", err), myWindow)
|
||||
return
|
||||
}
|
||||
log.Debug("Game launched with integrated terminal. Check the application logs for output.")
|
||||
// Use integrated terminal
|
||||
log.Debugf("Shell command for integrated terminal: %s", shellCmd)
|
||||
log.Debug("Executing WoW launch command with integrated terminal...")
|
||||
if err := runGameIntegrated(myWindow, shellCmd); err != nil {
|
||||
dialog.ShowError(fmt.Errorf("failed to launch game: %v", err), myWindow)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user