Skip to content

Commit 0889dd8

Browse files
committed
log implementation update
1 parent 679216a commit 0889dd8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cmd/dyndns-r53.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func main() {
3838
h := slog.NewTextHandler(file, &slog.HandlerOptions{Level: programLevel})
3939
logger := slog.New(h)
4040

41-
logger.Info("------------------ Starting IP update... ------------------")
41+
logger.Info("------------------ Starting IP update ------------------")
4242

4343
// Read the command line flags
4444
flags := parseFlags()
@@ -52,12 +52,12 @@ func main() {
5252

5353
wanIP := dyndns.GetWanIP(logger)
5454

55-
// Update the FQDN's IP in case the current WAN ip is different from the IP bounded to the FQDN
55+
// Update the FQDN's IP in case the current WAN ip is different from the current FQDN IP
5656
if dyndns.GetFqdnIP(conf, logger) != wanIP {
57-
logger.Info("out-of-date update to", conf.Fqdn, wanIP)
57+
logger.Info("FQDN out-of-date, update to", conf.Fqdn, wanIP)
5858
dyndns.UpdateFqdnIP(conf, logger, wanIP)
5959
} else {
60-
logger.Info("'%s' is up-to-date", conf.Fqdn)
60+
logger.Info("FQDN is up-to-date", conf.Fqdn, wanIP)
6161
}
6262
}
6363

internal/app/dyndns/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func GetConfig(logger *slog.Logger) Config {
3232
log.Fatal(err.Error())
3333
}
3434

35-
logger.Info("Config Settings", "AccessKeyID", conf.AccessKeyID, "HostedZoneID",
35+
logger.Info("Config values", "AccessKeyID", conf.AccessKeyID, "HostedZoneID",
3636
conf.HostedZoneID, "Fqdn", conf.Fqdn, "Debug", conf.Debug)
3737

3838
return conf

internal/app/dyndns/ip-updater.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func GetWanIP(log *slog.Logger) string {
3636
if err := decoder.Decode(&body); err != nil {
3737
log.Error(err.Error())
3838
}
39-
log.Debug("Current WAN ip", "IP", body.IP)
39+
log.Debug("WAN status", "IP", body.IP)
4040
return body.IP
4141
}
4242

@@ -46,7 +46,7 @@ func GetFqdnIP(conf Config, log *slog.Logger) string {
4646
if err != nil {
4747
log.Error(err.Error())
4848
}
49-
log.Debug("Current ip bounded to '%s': %s", conf.Fqdn, ips[0])
49+
log.Debug("FQDN status", conf.Fqdn, ips[0])
5050
return ips[0]
5151
}
5252

0 commit comments

Comments
 (0)