We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb11521 commit aab8c38Copy full SHA for aab8c38
core/logx/logs_test.go
@@ -1054,3 +1054,27 @@ type panicStringer struct {
1054
func (s panicStringer) String() string {
1055
panic("panic")
1056
}
1057
+
1058
+func TestSetupFileTimeFormat(t *testing.T) {
1059
+ testFileTimeFormat := "2006-01-02T15-04-05.000"
1060
+ MustSetup(LogConf{
1061
+ ServiceName: "any",
1062
+ Mode: "file",
1063
+ Encoding: "json",
1064
+ TimeFormat: timeFormat,
1065
+ FileTimeFormat: testFileTimeFormat,
1066
+ Path: "./logtest/log",
1067
+ Level: "debug",
1068
+ //Compress: true,
1069
+ KeepDays: 2,
1070
+ StackCooldownMillis: 1,
1071
+ MaxBackups: 2,
1072
+ MaxSize: 1,
1073
+ Rotation: "size",
1074
+ })
1075
1076
+ for i := 0; i < 10000000; i++ {
1077
+ Infof("%stestinfo============================>%d", testFileTimeFormat, i)
1078
+ }
1079
1080
+}
0 commit comments