Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
刘洪宝
committed
Oct 19, 2018
1 parent
d75b731
commit 3d4af75
Showing
6 changed files
with
960 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.idea/ | ||
vendor/ | ||
bingo.log | ||
example/bingo.log | ||
size_coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
package bingo_log | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestBaseConnector_Fatal(t *testing.T) { | ||
type args struct { | ||
message string | ||
} | ||
tests := []struct { | ||
name string | ||
b BaseConnector | ||
args args | ||
}{ | ||
{ | ||
name: "case", | ||
b: BaseConnector{}, | ||
args: struct{ message string }{message: "fatal testing"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
b := BaseConnector{} | ||
b.Fatal(tt.args.message) | ||
}) | ||
} | ||
} | ||
|
||
func TestBaseConnector_Error(t *testing.T) { | ||
type args struct { | ||
message string | ||
} | ||
tests := []struct { | ||
name string | ||
b BaseConnector | ||
args args | ||
}{ | ||
{ | ||
name: "case", | ||
b: BaseConnector{}, | ||
args: struct{ message string }{message: "Error testing"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
b := BaseConnector{} | ||
b.Error(tt.args.message) | ||
}) | ||
} | ||
} | ||
|
||
func TestBaseConnector_Warning(t *testing.T) { | ||
type args struct { | ||
message string | ||
} | ||
tests := []struct { | ||
name string | ||
b BaseConnector | ||
args args | ||
}{ | ||
{ | ||
name: "case", | ||
b: BaseConnector{}, | ||
args: struct{ message string }{message: "Warning testing"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
b := BaseConnector{} | ||
b.Warning(tt.args.message) | ||
}) | ||
} | ||
} | ||
|
||
func TestBaseConnector_Debug(t *testing.T) { | ||
type args struct { | ||
message string | ||
} | ||
tests := []struct { | ||
name string | ||
b BaseConnector | ||
args args | ||
}{ | ||
{ | ||
name: "case", | ||
b: BaseConnector{}, | ||
args: struct{ message string }{message: "Debug testing"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
b := BaseConnector{} | ||
b.Debug(tt.args.message) | ||
}) | ||
} | ||
} | ||
|
||
func TestBaseConnector_Info(t *testing.T) { | ||
type args struct { | ||
message string | ||
} | ||
tests := []struct { | ||
name string | ||
b BaseConnector | ||
args args | ||
}{ | ||
{ | ||
name: "case", | ||
b: BaseConnector{}, | ||
args: struct{ message string }{message: "Info testing"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
b := BaseConnector{} | ||
b.Info(tt.args.message) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/silsuer/bingo-log" | ||
"strconv" | ||
"fmt" | ||
) | ||
|
||
func main() { | ||
//fmt.Println(os.Getwd()) | ||
//c:= bingo_log.NewLog(bingo_log.LogSyncMode) | ||
//b := new(bingo_log.BaseConnector) | ||
//c.LoadConnector(b) // 加载连接器 | ||
//c.Warning("ddd") | ||
//c := bingo_log.NewLog(bingo_log.LogPoolMode) | ||
c:= bingo_log.NewLog(bingo_log.LogSyncMode) | ||
c.SetPoolExpiredTime(100) | ||
c.SetPoolWorkerNum(100) | ||
|
||
b := new(bingo_log.BaseConnector) | ||
c.LoadConnector(b) | ||
|
||
//s := sync.WaitGroup{} | ||
|
||
for i := 0; i < 1000; i++ { | ||
//s.Add() | ||
c.Debug("这是第" + strconv.Itoa(i) + "次输入") | ||
} | ||
fmt.Println("Done!") | ||
} |
Oops, something went wrong.