Skip to content

Commit

Permalink
🚸 Comment out unusable logtype and logformat
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <[email protected]>

:white_check_mark: fix tests for logger type, format

Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx committed Jan 21, 2021
1 parent 8a7f4f7 commit 347e7da
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 124 deletions.
10 changes: 5 additions & 5 deletions internal/log/format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
Unknown Format = iota
RAW
JSON
LTSV
// LTSV
)

func (f Format) String() string {
Expand All @@ -33,8 +33,8 @@ func (f Format) String() string {
return "raw"
case JSON:
return "json"
case LTSV:
return "ltsv"
// case LTSV:
// return "ltsv"
}
return "unknown"
}
Expand All @@ -45,8 +45,8 @@ func Atof(str string) Format {
return RAW
case "json":
return JSON
case "ltsv":
return LTSV
// case "ltsv":
// return LTSV
}
return Unknown
}
44 changes: 22 additions & 22 deletions internal/log/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ func TestFormat_String(t *testing.T) {
},
},

{
name: "returns ltsv when f is LTSV",
f: LTSV,
want: want{
want: "ltsv",
},
},
// {
// name: "returns ltsv when f is LTSV",
// f: LTSV,
// want: want{
// want: "ltsv",
// },
// },

{
name: "returns unknown when f is 100",
Expand Down Expand Up @@ -148,21 +148,21 @@ func TestAtof(t *testing.T) {
},
},

{
name: "returns LTSV when str is `ltsv`",
str: "ltsv",
want: want{
want: LTSV,
},
},

{
name: "returns LTSV when str is `LTSv`",
str: "LTSv",
want: want{
want: LTSV,
},
},
// {
// name: "returns LTSV when str is `ltsv`",
// str: "ltsv",
// want: want{
// want: LTSV,
// },
// },
//
// {
// name: "returns LTSV when str is `LTSv`",
// str: "LTSv",
// want: want{
// want: LTSV,
// },
// },

{
name: "returns Unknown when str is `Vald`",
Expand Down
30 changes: 15 additions & 15 deletions internal/log/logger/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const (
Unknown Type = iota
GLG
ZAP
ZEROLOG
LOGRUS
KLOG
// ZEROLOG
// LOGRUS
// KLOG
)

func (m Type) String() string {
Expand All @@ -35,12 +35,12 @@ func (m Type) String() string {
return "glg"
case ZAP:
return "zap"
case ZEROLOG:
return "zerolog"
case LOGRUS:
return "logrus"
case KLOG:
return "klog"
// case ZEROLOG:
// return "zerolog"
// case LOGRUS:
// return "logrus"
// case KLOG:
// return "klog"
}
return "unknown"
}
Expand All @@ -51,12 +51,12 @@ func Atot(str string) Type {
return GLG
case "zap":
return ZAP
case "zerolog":
return ZEROLOG
case "logrus":
return LOGRUS
case "klog":
return KLOG
// case "zerolog":
// return ZEROLOG
// case "logrus":
// return LOGRUS
// case "klog":
// return KLOG
}
return Unknown
}
164 changes: 82 additions & 82 deletions internal/log/logger/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@ func TestType_String(t *testing.T) {
},
},

{
name: "returns zerolog when m is ZEROLOG",
m: ZEROLOG,
want: want{
want: "zerolog",
},
},

{
name: "returns logrus when m is LOGRUS",
m: LOGRUS,
want: want{
want: "logrus",
},
},

{
name: "returns klog when m is KLOG",
m: KLOG,
want: want{
want: "klog",
},
},
// {
// name: "returns zerolog when m is ZEROLOG",
// m: ZEROLOG,
// want: want{
// want: "zerolog",
// },
// },
//
// {
// name: "returns logrus when m is LOGRUS",
// m: LOGRUS,
// want: want{
// want: "logrus",
// },
// },
//
// {
// name: "returns klog when m is KLOG",
// m: KLOG,
// want: want{
// want: "klog",
// },
// },

{
name: "returns unknown when m is unknown",
Expand Down Expand Up @@ -175,65 +175,65 @@ func TestAtot(t *testing.T) {
},
},

{
name: "returns ZEROLOG when str is `zerolog`",
args: args{
str: "zerolog",
},
want: want{
want: ZEROLOG,
},
},

{
name: "returns ZEROLOG when str is `ZEROLOg`",
args: args{
str: "ZEROLOg",
},
want: want{
want: ZEROLOG,
},
},

{
name: "returns LOGRUS when str is `logrus`",
args: args{
str: "logrus",
},
want: want{
want: LOGRUS,
},
},

{
name: "returns LOGRUS when str is `LOGRUs`",
args: args{
str: "LOGRUs",
},
want: want{
want: LOGRUS,
},
},

{
name: "returns KLOG when str is `klog`",
args: args{
str: "klog",
},
want: want{
want: KLOG,
},
},

{
name: "returns KLOG when str is `KLOg`",
args: args{
str: "KLog",
},
want: want{
want: KLOG,
},
},
// {
// name: "returns ZEROLOG when str is `zerolog`",
// args: args{
// str: "zerolog",
// },
// want: want{
// want: ZEROLOG,
// },
// },
//
// {
// name: "returns ZEROLOG when str is `ZEROLOg`",
// args: args{
// str: "ZEROLOg",
// },
// want: want{
// want: ZEROLOG,
// },
// },
//
// {
// name: "returns LOGRUS when str is `logrus`",
// args: args{
// str: "logrus",
// },
// want: want{
// want: LOGRUS,
// },
// },
//
// {
// name: "returns LOGRUS when str is `LOGRUs`",
// args: args{
// str: "LOGRUs",
// },
// want: want{
// want: LOGRUS,
// },
// },
//
// {
// name: "returns KLOG when str is `klog`",
// args: args{
// str: "klog",
// },
// want: want{
// want: KLOG,
// },
// },
//
// {
// name: "returns KLOG when str is `KLOg`",
// args: args{
// str: "KLog",
// },
// want: want{
// want: KLOG,
// },
// },

{
name: "returns unknown when str is `Vald`",
Expand Down

0 comments on commit 347e7da

Please sign in to comment.