// openSchedules reads the schedules of the file at path. A missing file holds
// none. The clock gives the time and the time zone of the schedules, and logger
// gets one line for each run.
// openSchedules reads the schedules of the file at path. A missing file holds
// none. The clock gives the time and the time zone of the schedules, and logger
// gets one line for each run.
-func openSchedules(path string, clock func() time.Time, logger *log.Logger) (*Schedules, error) {
+func openSchedules(path string, clock func() time.Time, logger *slog.Logger) (*Schedules, error) {
- s.logger.Printf("schedule %d ran %s late", schedule.ID, durationText(now.Sub(schedule.Due)))
- } else {
- s.logger.Printf("schedule %d ran", schedule.ID)
+ attrs = append(attrs, "late", now.Sub(schedule.Due))