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:
@@ -21,6 +21,10 @@ const (
|
||||
LevelFatal
|
||||
)
|
||||
|
||||
func (l Level) Key() string {
|
||||
return LevelKey
|
||||
}
|
||||
|
||||
func (l Level) String() string {
|
||||
switch l {
|
||||
case LevelDebug:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user