Skip to content

Commit

Permalink
Update logs
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Feb 16, 2024
1 parent b764908 commit dec54d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions timesyncsensor/timesyncsensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func init() {
Constructor: func(ctx context.Context, deps resource.Dependencies, conf resource.Config, logger logging.Logger) (sensor.Sensor, error) {
sensorConfig, err := resource.NativeConfig[*Config](conf)
if err != nil {
logger.Warnf("Error configuring module with %+s", err)
logger.Warn("Error configuring module with ", err)
return nil, err
}

Expand All @@ -43,7 +43,7 @@ func init() {
cancelFunc: cancelFunc,
}
if err := v.Reconfigure(ctx, deps, conf); err != nil {
logger.Warnf("Error configuring module with %+s", err)
logger.Warn("Error configuring module with ", err)
return nil, err
}
return v, nil
Expand Down Expand Up @@ -93,15 +93,15 @@ func (s *timeSyncer) Name() resource.Name {
func (s *timeSyncer) Reconfigure(ctx context.Context, deps resource.Dependencies, conf resource.Config) error {
sensorConfig, err := resource.NativeConfig[*Config](conf)
if err != nil {
s.logger.Warnf("Error reconfiguring module with %+s", err)
s.logger.Warn("Error reconfiguring module with ", err)
return nil
}

s.start = sensorConfig.Start
s.end = sensorConfig.End
s.name = conf.ResourceName()
s.logger.Info("Start time for sync now: %+s", s.start)
s.logger.Info("End time for sync now: %+s", s.end)
s.logger.Info("Start time for sync now: ", s.start)
s.logger.Info("End time for sync now: ", s.end)

return nil
}
Expand All @@ -127,7 +127,7 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri

zone, err := time.LoadLocation(s.zone)
if err != nil {
s.logger.Error("Time zone cannot be loaded: %+s", s.zone)
s.logger.Error("Time zone cannot be loaded: ", s.zone)
}

startTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(),
Expand Down

0 comments on commit dec54d0

Please sign in to comment.