Skip to content

Commit

Permalink
Implement Stringer for katcSourceType
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Jul 23, 2024
1 parent 245a146 commit 250470f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 7 additions & 0 deletions ee/katc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ func (kst *katcSourceType) UnmarshalJSON(data []byte) error {
}
}

func (kst *katcSourceType) String() string {
if kst == nil {
return ""
}
return kst.name
}

// rowTransformStep defines an operation performed against a row of data
// returned from a source. The `name` is the identifier parsed from the
// JSON KATC config.
Expand Down
6 changes: 1 addition & 5 deletions ee/katc/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,9 @@ func newKatcTable(tableName string, cfg katcTableConfig, slogger *slog.Logger) (
}

// Add extra fields to slogger
var tableType string
if cfg.SourceType != nil {
tableType = cfg.SourceType.name
}
k.slogger = slogger.With(
"table_name", tableName,
"table_type", tableType,
"table_type", cfg.SourceType.String(),
)

return &k, columns
Expand Down

0 comments on commit 250470f

Please sign in to comment.