Skip to content

Commit

Permalink
Bug fix convert time and primitive.Datetime to string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cataldo committed Jan 28, 2024
1 parent 757b01c commit 87f6f2c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ go-logger
=================
<img align="right" src="gopher-logger.png" alt="">

[![Project status](https://img.shields.io/badge/version-v1.1.9-vividgreen.svg)](https://github.com/GabrielHCataldo/go-logger/releases/tag/v1.1.9)
[![Project status](https://img.shields.io/badge/version-v1.2.0-vividgreen.svg)](https://github.com/GabrielHCataldo/go-logger/releases/tag/v1.2.0)
[![Go Report Card](https://goreportcard.com/badge/github.com/GabrielHCataldo/go-logger)](https://goreportcard.com/report/github.com/GabrielHCataldo/go-logger)
[![Coverage Status](https://coveralls.io/repos/GabrielHCataldo/go-logger/badge.svg?branch=main&service=github)](https://coveralls.io/github/GabrielHCataldo/go-logger?branch=main)
[![Open Source Helpers](https://www.codetriage.com/gabrielhcataldo/go-logger/badges/users.svg)](https://www.codetriage.com/gabrielhcataldo/go-logger)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21.3
require github.com/iancoleman/orderedmap v0.3.0

require (
github.com/GabrielHCataldo/go-helper v1.3.3
github.com/GabrielHCataldo/go-helper v1.3.4
github.com/cockroachdb/apd v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-playground/locales v0.14.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/GabrielHCataldo/go-helper v1.3.2 h1:6ldvGEslDVN/1iAFT/AyxM+F3orPJzxCr
github.com/GabrielHCataldo/go-helper v1.3.2/go.mod h1:+whI36aUg1BfvLpZWJ8j81+d5iPuxl58ApOJqTIliCU=
github.com/GabrielHCataldo/go-helper v1.3.3 h1:9KA/3GSkHB5SjkFOY+DuZHSHSxjNo/SQkOnWXdBghzg=
github.com/GabrielHCataldo/go-helper v1.3.3/go.mod h1:+whI36aUg1BfvLpZWJ8j81+d5iPuxl58ApOJqTIliCU=
github.com/GabrielHCataldo/go-helper v1.3.4 h1:Rcf7gRbk6oI/YrZMIcieOotA2nldAoIjeiky+hHVPv8=
github.com/GabrielHCataldo/go-helper v1.3.4/go.mod h1:+whI36aUg1BfvLpZWJ8j81+d5iPuxl58ApOJqTIliCU=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
7 changes: 2 additions & 5 deletions logger/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,14 @@ func prepareValue(value any, tag string) any {
return prepareMapMsg(value, true, tag)
} else if helper.IsSlice(value) {
return prepareSliceMsg(value, true, tag)
} else if strings.Contains(tag, loggerTagHide) || strings.Contains(tag, loggerTagMaskStart) ||
strings.Contains(tag, loggerTagMaskEnd) {
return convertStringReflectValue(value, tag)
} else if helper.IsNotNil(value) {
return convertStringReflectValue(value, tag)
return convertValueToString(value, tag)
} else {
return nil
}
}

func convertStringReflectValue(value any, tag string) string {
func convertValueToString(value any, tag string) string {
s := helper.SimpleConvertToString(value)
if helper.IsEmpty(s) {
return s
Expand Down

0 comments on commit 87f6f2c

Please sign in to comment.