logging_windows.go 450 B

1234567891011121314151617181920
  1. package lifecycle
  2. import (
  3. "fmt"
  4. "log/slog"
  5. "os/exec"
  6. "syscall"
  7. )
  8. func ShowLogs() {
  9. cmd_path := "c:\\Windows\\system32\\cmd.exe"
  10. slog.Debug(fmt.Sprintf("viewing logs with start %s", AppDataDir))
  11. cmd := exec.Command(cmd_path, "/c", "start", AppDataDir)
  12. cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: false, CreationFlags: 0x08000000}
  13. err := cmd.Start()
  14. if err != nil {
  15. slog.Error(fmt.Sprintf("Failed to open log dir: %s", err))
  16. }
  17. }