diff --git a/components/camera/videosource/webcam.go b/components/camera/videosource/webcam.go index fe24dbfe847..de8175775c0 100644 --- a/components/camera/videosource/webcam.go +++ b/components/camera/videosource/webcam.go @@ -331,7 +331,6 @@ type webcam struct { disconnected bool activeBackgroundWorkers sync.WaitGroup logger logging.Logger - originalLogger logging.Logger } // NewWebcam returns the webcam discovered based on the given config as the Camera interface type. @@ -346,7 +345,6 @@ func NewWebcam( cam := &webcam{ Named: conf.ResourceName().AsNamed(), logger: logger.WithFields("camera_name", conf.ResourceName().ShortName()), - originalLogger: logger, cancelCtx: cancelCtx, cancel: cancel, } @@ -475,7 +473,7 @@ func (c *webcam) reconnectCamera(conf *WebcamConfig) error { c.targetPath = foundLabel } - c.logger = c.originalLogger.WithFields("camera_label", c.targetPath) + c.logger = c.logger.WithFields("camera_label", c.targetPath) return nil }