|
|
@ -1,19 +1,20 @@ |
|
|
|
package logkit |
|
|
|
package logkit |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"flag" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
func init() { |
|
|
|
Init(SYSLOG, "test", LevelInfo) |
|
|
|
var l Level |
|
|
|
|
|
|
|
flag.Int("level", int(l) , "l") |
|
|
|
} |
|
|
|
flag.Parse() |
|
|
|
func TestGoKit(t *testing.T) { |
|
|
|
println(l.Get()) |
|
|
|
Init(FIlE, "test", LevelDebug) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func BenchmarkGoKit(b *testing.B) { |
|
|
|
func BenchmarkGoKit(b *testing.B) { |
|
|
|
defer Exit() |
|
|
|
defer Exit() |
|
|
|
|
|
|
|
|
|
|
@ -53,3 +54,6 @@ func TestBuffer(t *testing.T) { |
|
|
|
Infof("test %s --- %s", "1", "23") |
|
|
|
Infof("test %s --- %s", "1", "23") |
|
|
|
//Exit()
|
|
|
|
//Exit()
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestFlag(t *testing.T) { |
|
|
|
|
|
|
|
} |
|
|
|