forked from p53841790/wheat-cache
commit
b168eecbb4
|
@ -11,7 +11,12 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
floor = 3
|
||||
)
|
||||
|
||||
func With(ctx context.Context, p event.ProduceInterface) *upLogger {
|
||||
floor = 4
|
||||
return &upLogger{
|
||||
ctx: ctx,
|
||||
produce: p,
|
||||
|
@ -40,7 +45,12 @@ func (l *upLogger) Print(level string, format string, msg ...interface{}) {
|
|||
Print(level, format, msg...)
|
||||
|
||||
eventMiddle := event.NewEvent(middleMsg.EventNameLog)
|
||||
eventMiddle.SetValue(middleMsg.EventKeyLog, middleMsg.LogContext{})
|
||||
eventMiddle.SetValue(middleMsg.EventKeyLog, middleMsg.LogContext{
|
||||
Level: level,
|
||||
Data: time.Now(),
|
||||
Msg: fmt.Sprintf(format, msg...),
|
||||
Route: findPlace(),
|
||||
})
|
||||
l.produce.Call(l.ctx, eventMiddle)
|
||||
}
|
||||
|
||||
|
@ -80,7 +90,7 @@ func findPlace() string {
|
|||
|
||||
var (
|
||||
place string
|
||||
i = 0
|
||||
i = floor
|
||||
)
|
||||
|
||||
for {
|
||||
|
|
Loading…
Reference in New Issue