Skip to content

Commit

Permalink
Logging improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty committed Sep 19, 2024
1 parent bf2504c commit d8610da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions matter/spec/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,8 @@ func (sp *Builder) resolveDataType(spec *Specification, cluster *matter.Cluster,
if dataType.Entity == nil {
dataType.Entity = getCustomDataType(spec, dataType.Name, cluster, field)
if dataType.Entity == nil {

slog.Warn("unknown custom data type", slog.String("cluster", clusterName(cluster)), slog.String("field", field.Name), slog.String("type", dataType.Name), log.Path("source", field))
slog.Error("unknown custom data type", slog.String("cluster", clusterName(cluster)), slog.String("field", field.Name), slog.String("type", dataType.Name), log.Path("source", field))
}

}
if cluster == nil || dataType.Entity == nil {
return
Expand Down Expand Up @@ -370,7 +368,7 @@ func disambiguateDataType(entities map[types.Entity]*matter.Cluster, cluster *ma
} else {
clusterName = "naked"
}
slog.Warn("ambiguous data type", "model", m, "cluster", clusterName)
slog.Warn("ambiguous data type", "model", m.Source(), "cluster", clusterName)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion matter/spec/datatypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (d *Doc) getRowConstraint(row *asciidoc.TableRow, columnMap ColumnIndex, co
var c constraint.Constraint
c, err := constraint.ParseString(val)
if err != nil {
slog.Warn("failed parsing constraint cell", log.Element("path", d.Path, cell), slog.String("constraint", val))
slog.Error("failed parsing constraint cell", log.Element("path", d.Path, cell), slog.String("constraint", val))
return &constraint.GenericConstraint{Value: val}
}
return c
Expand Down

0 comments on commit d8610da

Please sign in to comment.