From d8610da7e4d4ebda6fb5b943af64d99b3d84c2d6 Mon Sep 17 00:00:00 2001 From: Hasty Granbery Date: Thu, 19 Sep 2024 14:51:01 -0700 Subject: [PATCH] Logging improvements --- matter/spec/build.go | 6 ++---- matter/spec/datatypes.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/matter/spec/build.go b/matter/spec/build.go index faf05980..bf0259f7 100644 --- a/matter/spec/build.go +++ b/matter/spec/build.go @@ -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 @@ -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 } diff --git a/matter/spec/datatypes.go b/matter/spec/datatypes.go index 7a93ebb8..912d5e6e 100644 --- a/matter/spec/datatypes.go +++ b/matter/spec/datatypes.go @@ -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