Skip to content

Commit

Permalink
feat: use context logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Stumble committed Sep 20, 2023
1 parent b4d87d8 commit 53c6082
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/codegen/golang/templates/wpgx/queryCode.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.Pair}} {{.Invalida
key := {{.CacheKey}}
err = q.cache.Invalidate(ctx, key)
if err != nil {
log.Error().Err(err).Msgf(
log.Ctx(ctx).Error().Err(err).Msgf(
"Failed to invalidate: %s", key)
anyErr = err
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.Pair}} {{.Invalida
key := {{.CacheKey}}
err = q.cache.Invalidate(ctx, key)
if err != nil {
log.Error().Err(err).Msgf(
log.Ctx(ctx).Error().Err(err).Msgf(
"Failed to invalidate: %s", key)
anyErr = err
}
Expand Down Expand Up @@ -198,7 +198,7 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.Pair}} {{.Invalida
key := {{.CacheKey}}
err = q.cache.Invalidate(ctx, key)
if err != nil {
log.Error().Err(err).Msgf(
log.Ctx(ctx).Error().Err(err).Msgf(
"Failed to invalidate: %s", key)
anyErr = err
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.Pair}} {{.Invalida
key := {{.CacheKey}}
err = q.cache.Invalidate(ctx, key)
if err != nil {
log.Error().Err(err).Msgf(
log.Ctx(ctx).Error().Err(err).Msgf(
"Failed to invalidate: %s", key)
anyErr = err
}
Expand Down Expand Up @@ -266,7 +266,7 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.Pair}} {{.Invalida
key := {{.CacheKey}}
err = q.cache.Invalidate(ctx, key)
if err != nil {
log.Error().Err(err).Msgf(
log.Ctx(ctx).Error().Err(err).Msgf(
"Failed to invalidate: %s", key)
anyErr = err
}
Expand Down

0 comments on commit 53c6082

Please sign in to comment.