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

do not override logger with WithValues() as it creates many duplicate… #192

Merged
merged 1 commit into from
Feb 1, 2025
Merged
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
8 changes: 4 additions & 4 deletions cloud/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ func (s *Scheduler) WaitStatus(ctx context.Context, config *api.VirtualMachineCr

// create new qemu with given spec and context
func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.SchedulerResult, error) {
s.logger = s.logger.WithValues("qemu", config.Name)
s.logger.Info("adding qemu to scheduler queue")
log := s.logger.WithValues("qemu", config.Name)
log.Info("adding qemu to scheduler queue")
// add qemu spec into the queue
s.schedulingQueue.Add(ctx, config)

Expand All @@ -262,10 +262,10 @@ func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCr
return status.Result(), err
}
if status.Error() != nil {
s.logger.Error(status.Error(), fmt.Sprintf("failed to create qemu: %v", status.Messages()))
log.Error(status.Error(), fmt.Sprintf("failed to create qemu: %v", status.Messages()))
return status.Result(), status.Error()
}
s.logger.Info(fmt.Sprintf("%v", status.Messages()))
log.Info(fmt.Sprintf("%v", status.Messages()))
return status.Result(), nil
}

Expand Down