Skip to content

Commit

Permalink
refactor: log enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
morlay committed Apr 9, 2024
1 parent 05a5fcd commit 14e2edf
Show file tree
Hide file tree
Showing 47 changed files with 1,340 additions and 1,485 deletions.
2 changes: 1 addition & 1 deletion cmd/example/apis/archive/zz_generated.operator.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package archive GENERATED BY gengo:operator
Package archive GENERATED BY gengo:operator
DON'T EDIT THIS FILE
*/
package archive
Expand Down
2 changes: 1 addition & 1 deletion cmd/example/apis/archive/zz_generated.runtimedoc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package archive GENERATED BY gengo:runtimedoc
Package archive GENERATED BY gengo:runtimedoc
DON'T EDIT THIS FILE
*/
package archive
Expand Down
14 changes: 9 additions & 5 deletions cmd/example/apis/org/zz_generated.enum.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package org GENERATED BY gengo:enum
Package org GENERATED BY gengo:enum
DON'T EDIT THIS FILE
*/
package org
Expand Down Expand Up @@ -43,8 +43,9 @@ func ParseTypeFromString(s string) (Type, error) {
case "COMPANY":
return TYPE__COMPANY, nil

default:
return TYPE_UNKNOWN, InvalidType
}
return TYPE_UNKNOWN, InvalidType
}

func (v Type) String() string {
Expand All @@ -54,8 +55,9 @@ func (v Type) String() string {
case TYPE__COMPANY:
return "COMPANY"

default:
return "UNKNOWN"
}
return "UNKNOWN"
}

func ParseTypeLabelString(label string) (Type, error) {
Expand All @@ -65,8 +67,9 @@ func ParseTypeLabelString(label string) (Type, error) {
case "企事业单位":
return TYPE__COMPANY, nil

default:
return TYPE_UNKNOWN, InvalidType
}
return TYPE_UNKNOWN, InvalidType
}

func (v Type) Label() string {
Expand All @@ -76,8 +79,9 @@ func (v Type) Label() string {
case TYPE__COMPANY:
return "企事业单位"

default:
return "UNKNOWN"
}
return "UNKNOWN"
}

func (v Type) Value() (database_sql_driver.Value, error) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/example/apis/org/zz_generated.operator.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package org GENERATED BY gengo:operator
Package org GENERATED BY gengo:operator
DON'T EDIT THIS FILE
*/
package org
Expand Down Expand Up @@ -30,7 +30,7 @@ func init() {
}

func (*GetOrg) ResponseContent() any {
return nil
return new(Detail)
}

func (*GetOrg) ResponseErrors() []error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/example/apis/org/zz_generated.runtimedoc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package org GENERATED BY gengo:runtimedoc
Package org GENERATED BY gengo:runtimedoc
DON'T EDIT THIS FILE
*/
package org
Expand Down
1 change: 0 additions & 1 deletion cmd/example/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ func init() {
type Serve struct {
cli.C `component:"server"`
otel.Otel
Metric otel.Metric
Server http.Server
}
2 changes: 1 addition & 1 deletion cmd/example/zz_generated.runtimedoc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Package main GENERATED BY gengo:runtimedoc
Package main GENERATED BY gengo:runtimedoc
DON'T EDIT THIS FILE
*/
package main
Expand Down
69 changes: 35 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,60 @@ module github.com/innoai-tech/infra
go 1.22

require (
cuelang.org/go v0.8.0
cuelang.org/go v0.8.1
github.com/andybalholm/brotli v1.1.0
github.com/fatih/color v1.16.0
github.com/felixge/httpsnoop v1.0.4
github.com/go-courier/logr v0.3.0
github.com/octohelm/courier v0.0.0-20240326021148-b5564592fbe1
github.com/octohelm/gengo v0.0.0-20240227021734-f42e02623187
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0
github.com/octohelm/courier v0.0.0-20240409065337-58f586c9d64c
github.com/octohelm/gengo v0.0.0-20240409082121-aeffa5400f19
github.com/octohelm/storage v0.0.0-20240309041530-950a8155cecf
github.com/octohelm/x v0.0.0-20240219080259-91528f21e203
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/prometheus v0.51.1
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
go.opentelemetry.io/contrib/propagators/b3 v1.24.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0
go.opentelemetry.io/otel/exporters/prometheus v0.46.0
go.opentelemetry.io/otel/metric v1.24.0
go.opentelemetry.io/otel/sdk v1.24.0
go.opentelemetry.io/otel/sdk/metric v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
golang.org/x/net v0.22.0
golang.org/x/sync v0.6.0
go.opentelemetry.io/contrib/propagators/b3 v1.25.0
go.opentelemetry.io/otel v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0
go.opentelemetry.io/otel/exporters/prometheus v0.47.0
go.opentelemetry.io/otel/log v0.1.0-alpha
go.opentelemetry.io/otel/metric v1.25.0
go.opentelemetry.io/otel/sdk v1.25.0
go.opentelemetry.io/otel/sdk/log v0.0.0-20240409082250-b9752eb5dc19
go.opentelemetry.io/otel/sdk/metric v1.25.0
go.opentelemetry.io/otel/trace v1.25.0
golang.org/x/net v0.24.0
golang.org/x/sync v0.7.0
golang.org/x/term v0.19.0
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
github.com/aws/aws-sdk-go v1.51.11 // indirect
github.com/aws/aws-sdk-go v1.51.17 // indirect
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -75,26 +77,25 @@ require (
github.com/onsi/gomega v1.31.1 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.52.2 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/grpc v1.62.1 // indirect
golang.org/x/tools v0.20.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 14e2edf

Please sign in to comment.