1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-11-06 08:59:18 +02:00

fix(log): toString float32 precision loss and convert uint use FormatUint (#2461)

* fix(log): toString float32 precision loss

* convert uint to string
This commit is contained in:
Jesse
2022-10-19 15:07:58 +08:00
committed by GitHub
parent 4bd1fde7ef
commit a911f8f9ee
6 changed files with 128 additions and 67 deletions

View File

@@ -21,6 +21,10 @@ const (
LevelFatal
)
func (l Level) Key() string {
return LevelKey
}
func (l Level) String() string {
switch l {
case LevelDebug:

View File

@@ -2,6 +2,12 @@ package log
import "testing"
func TestLevel_Key(t *testing.T) {
if LevelInfo.Key() != LevelKey {
t.Errorf("want: %s, got: %s", LevelKey, LevelInfo.Key())
}
}
func TestLevel_String(t *testing.T) {
tests := []struct {
name string