Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: print debug logs after newline #273

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (iva *initVMAction) run() error {
iva.logger.Info("Initializing and starting Finch virtual machine...")
logs, err := limaCmd.CombinedOutput()
if err != nil {
iva.logger.Errorf("Finch virtual machine failed to start, debug logs: %s", logs)
iva.logger.Errorf("Finch virtual machine failed to start, debug logs:\n%s", logs)
return err
}
iva.logger.Info("Finch virtual machine started successfully")
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestInitVMAction_run(t *testing.T) {
mockBaseYamlFilePath, "--tty=false").Return(command)

logger.EXPECT().Info("Initializing and starting Finch virtual machine...")
logger.EXPECT().Errorf("Finch virtual machine failed to start, debug logs: %s", logs)
logger.EXPECT().Errorf("Finch virtual machine failed to start, debug logs:\n%s", logs)
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (rva *removeVMAction) removeVM(force bool) error {
}
logs, err := limaCmd.CombinedOutput()
if err != nil {
rva.logger.Errorf("Finch virtual machine failed to remove, debug logs: %s", logs)
rva.logger.Errorf("Finch virtual machine failed to remove, debug logs:\n%s", logs)
return err
}
rva.logger.Info("Finch virtual machine removed successfully")
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestRemoveVMAction_run(t *testing.T) {
command.EXPECT().CombinedOutput().Return(logs, errors.New("failed to remove instance"))
creator.EXPECT().CreateWithoutStdio("remove", limaInstanceName).Return(command)
logger.EXPECT().Info("Removing existing Finch virtual machine...")
logger.EXPECT().Errorf("Finch virtual machine failed to remove, debug logs: %s", logs)
logger.EXPECT().Errorf("Finch virtual machine failed to remove, debug logs:\n%s", logs)
},
force: false,
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (sva *startVMAction) run() error {
sva.logger.Info("Starting existing Finch virtual machine...")
logs, err := limaCmd.CombinedOutput()
if err != nil {
sva.logger.Errorf("Finch virtual machine failed to start, debug logs: %s", logs)
sva.logger.Errorf("Finch virtual machine failed to start, debug logs:\n%s", logs)
return err
}
sva.logger.Info("Finch virtual machine started successfully")
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func TestStartVMAction_run(t *testing.T) {
lcc.EXPECT().CreateWithoutStdio("start", limaInstanceName).Return(command)

logger.EXPECT().Info("Starting existing Finch virtual machine...")
logger.EXPECT().Errorf("Finch virtual machine failed to start, debug logs: %s", logs)
logger.EXPECT().Errorf("Finch virtual machine failed to start, debug logs:\n%s", logs)
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (sva *stopVMAction) stopVM(force bool) error {
}
logs, err := limaCmd.CombinedOutput()
if err != nil {
sva.logger.Errorf("Finch virtual machine failed to stop, debug logs: %s", logs)
sva.logger.Errorf("Finch virtual machine failed to stop, debug logs:\n%s", logs)
return err
}
sva.logger.Info("Finch virtual machine stopped successfully")
Expand Down
2 changes: 1 addition & 1 deletion cmd/finch/virtual_machine_stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestStopVMAction_run(t *testing.T) {
command.EXPECT().CombinedOutput().Return(logs, errors.New("error"))
creator.EXPECT().CreateWithoutStdio("stop", limaInstanceName).Return(command)
logger.EXPECT().Info("Stopping existing Finch virtual machine...")
logger.EXPECT().Errorf("Finch virtual machine failed to stop, debug logs: %s", logs)
logger.EXPECT().Errorf("Finch virtual machine failed to stop, debug logs:\n%s", logs)
},
force: false,
},
Expand Down