master
guohao 5 years ago
parent e66407395d
commit 0635efeae7
  1. 4
      gokit.go
  2. 16
      gokit_test.go

@ -29,7 +29,7 @@ var (
)
//Level 日志等级
type Level byte
type Level int
const (
Default Level = iota
@ -112,7 +112,7 @@ func write(level Level, msg string) {
messageStr := format(level, msg)
logWriter.Write(level, messageStr)
if alsoStdout {
fmt.Println(messageStr)
fmt.Print(messageStr)
}
}

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

Loading…
Cancel
Save