Skip to content
Merged

Deps #119

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
go-version: "^1.20"
check-latest: true

- uses: golangci/golangci-lint-action@v6.5.2
- uses: golangci/golangci-lint-action@v9.2.1
with:
version: latest
args: --verbose
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/spilliams/terrascope

go 1.23.0
go 1.25

require (
github.com/awalterschulze/gographviz v2.0.3+incompatible
Expand All @@ -9,7 +9,7 @@ require (
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/sirupsen/logrus v1.9.4
github.com/spf13/cobra v1.10.2
github.com/zclconf/go-cty v1.16.3
github.com/zclconf/go-cty v1.18.1
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk=
github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty v1.18.1 h1:yEGE8M4iIZlyKQURZNb2SnEyZlZHUcBCnx6KF81KuwM=
github.com/zclconf/go-cty v1.18.1/go.mod h1:qpnV6EDNgC1sns/AleL1fvatHw72j+S+nS+MJ+T2CSg=
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
Expand Down
19 changes: 13 additions & 6 deletions internal/logformatter/logformatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ func (ptf *PrefixedTextFormatter) Format(entry *logrus.Entry) ([]byte, error) {
}

// this mutates b
print(b, entry, keys, timestampFormat, colorScheme)
err := print(b, entry, keys, timestampFormat, colorScheme)

return b.Bytes(), nil
return b.Bytes(), err
}

func print(wr io.Writer, entry *logrus.Entry, keys []string,
timestampFormat string, colorScheme *colorScheme) {
timestampFormat string, colorScheme *colorScheme) error {

levelColorFunc := colorScheme.levelColorFunc(entry.Level)
levelText := entry.Level.String()
Expand All @@ -75,16 +75,23 @@ func print(wr io.Writer, entry *logrus.Entry, keys []string,
timestampColorFunc := colorScheme.timestampColorFunc()
timestampText := timestampColorFunc(entry.Time.Format(timestampFormat))

fmt.Fprintf(wr, "%s%s %s%s", timestampText, levelText, prefixText, entry.Message)
_, err := fmt.Fprintf(wr, "%s%s %s%s", timestampText, levelText, prefixText, entry.Message)
if err != nil {
return err
}

for _, k := range keys {
if k == "prefix" {
continue
}

v := entry.Data[k]
fmt.Fprintf(wr, " %s=%+v", levelColorFunc(k), v)
_, err = fmt.Fprintf(wr, " %s=%+v", levelColorFunc(k), v)
if err != nil {
return err
}
}

fmt.Fprintln(wr, "")
_, err = fmt.Fprintln(wr, "")
return err
}
Loading