Skip to content

Commit

Permalink
improve log message format
Browse files Browse the repository at this point in the history
  • Loading branch information
nthienan committed May 13, 2023
1 parent 36acb32 commit 93283a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.3
0.3.4
8 changes: 4 additions & 4 deletions internal/plugins/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func InitDynamodb(configs []DynamoDbConfiguration, initializeCache bool) {
func buildProjectionExpression(fieldExpr string) (*string, map[string]*string) {
if len(fieldExpr) != 0 {
fields := strings.Split(fieldExpr, ",")
println(PrintPrefix, "Projection fields: %s", fields)
println(PrintPrefix, fmt.Sprintf("Projection fields: %s", fields))

proj := expression.NamesList(expression.Name(fields[0]))
for i := 1; i < len(fields); i++ {
Expand All @@ -62,7 +62,7 @@ func buildProjectionExpression(fieldExpr string) (*string, map[string]*string) {
WithProjection(proj).
Build()
if err != nil {
println(PrintPrefix, "Caught an unexpected error: %s", err)
println(PrintPrefix, fmt.Sprintf("Caught an unexpected error: %s", err))
}
return expr.Projection(), expr.Names()
}
Expand Down Expand Up @@ -134,7 +134,7 @@ func LoadData(config DynamoDbConfiguration) bool {

return true
} else {
println(PrintPrefix, "HashKey not available so caching will not be enabled for %s", config.HashKey)
println(PrintPrefix, fmt.Sprintf("HashKey not available so caching will not be enabled for %s", config.HashKey))
return false
}
}
Expand Down Expand Up @@ -229,7 +229,7 @@ func GetData(config DynamoDbConfiguration) string {

return value
} else {
println(PrintPrefix, "Hash key not available so caching will not be enabled for %s", config.HashKey)
println(PrintPrefix, "Hash key not available so caching will not be enabled for", config.HashKey)
return ""
}
}
Expand Down

0 comments on commit 93283a8

Please sign in to comment.