Skip to content

Commit

Permalink
logs: ensure log values are paired with field names
Browse files Browse the repository at this point in the history
When using hclog (or slog), each value we include after the initial string is
supposed to be a paired key and value. If not, we have unstructured noise with
the warning `EXTRA_VALUE_AT_END` in the logs.
  • Loading branch information
tgross committed Oct 4, 2024
1 parent d73ca85 commit 5f5e3ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudinit/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Controller) Apply(ci *Config, ciPath string) error {
ci.MetaData.InstanceID, err)
}

c.logger.Debug("meta-data", mdb.String())
c.logger.Debug("meta-data", "contents", mdb.String())

vdb := &bytes.Buffer{}
err = executeTemplate(ci, vendorDataTemplate, vdb)
Expand All @@ -100,7 +100,7 @@ func (c *Controller) Apply(ci *Config, ciPath string) error {
ci.MetaData.InstanceID, err)
}

c.logger.Debug("vendor-data", vdb.String())
c.logger.Debug("vendor-data", "contents", vdb.String())

var udb io.ReadWriter
if ci.UserDataPath != "" {
Expand Down

0 comments on commit 5f5e3ea

Please sign in to comment.