diff --git a/gokit.go b/gokit.go index 7eac156..b324864 100644 --- a/gokit.go +++ b/gokit.go @@ -127,9 +127,9 @@ func format(level Level, msg string) string { context = fmt.Sprintf("%s:%03d", path.Base(file), line) } - return fmt.Sprintf("%s\t[%3s]\t%s\t%s\n", time.Now().Format("2006-01-02 15:04:05.999"), getLevelName(level), context, msg) + return fmt.Sprintf("%s\t[%4s]\t%-20.64s\t%s\n", time.Now().Format("2006-01-02 15:04:05.999"), getLevelName(level), context, msg) } else { - return fmt.Sprintf("%s\t[%3s]\t%s\n", time.Now().Format("2006-01-02 15:04:05.999"), getLevelName(level), msg) + return fmt.Sprintf("%s\t[%4s]\t%s\n", time.Now().Format("2006-01-02 15:04:05.999"), getLevelName(level), msg) } } diff --git a/gokit_test.go b/gokit_test.go index 316ee5a..72e214a 100644 --- a/gokit_test.go +++ b/gokit_test.go @@ -1,7 +1,6 @@ package logkit import ( - "flag" "fmt" "strconv" "testing" @@ -9,13 +8,14 @@ import ( ) func init() { - var l Level - flag.Int("level", int(l) , "l") - flag.Parse() + //var l Level + //flag.Int("level", int(l) , "l") + //flag.Parse() } func BenchmarkGoKit(b *testing.B) { defer Exit() + SetPath("test.log") Init(FIlE, "test", LevelDebug, true, BasePath) b.ResetTimer() for i := 0; i < b.N; i++ {