Skip to content

Commit

Permalink
Merge pull request #1355 from stgraber/main
Browse files Browse the repository at this point in the history
incusd/instance/qmp: Fix logging with no log file
  • Loading branch information
hallyn authored Nov 6, 2024
2 parents b094ab7 + 1fef8b3 commit 8082084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/server/instance/drivers/qmp/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (m *Monitor) RunJSON(request []byte, resp any, logCommand bool) error {
responses := strings.Split(string(out), "\r\n")
out = []byte(responses[len(responses)-1])

if logCommand {
if logCommand && m.logFile != "" {
_, err = fmt.Fprintf(log, "[%s] REPLY: %s\n\n", time.Now().Format(time.RFC3339), out)
if err != nil {
return err
Expand Down

0 comments on commit 8082084

Please sign in to comment.