windzhu0514

Results 15 comments of windzhu0514

you can write a custom schedule,but this only support stand parser. ``` type StartNowSchedule struct { firstTime int32 schedule cron.Schedule } func NewStartNow(spec string) (*StartNowSchedule, error) { schedule, err :=...

也遇到了这个问题,中间件 logging 和 recovery 的写日志层级不一样

> Hi @windzhu0514! Thanks for the feature request! Could you include more information about what you would like to see? A screenshot from goland and a description of how you...

从biz层传递日志field到data层有什么好的方法吗?每个data层的接口都加一个logger参数?

之前也是使用创建data的时候传进去的logger新建一个helper,现在把logger放到context里传递

> > 之前也是使用创建data的时候传进去的logger新建一个helper,现在把logger放到context里传递 > > 老哥给个代码例子看看呗 ```go package logx import ( "context" "github.com/go-kratos/kratos/v2/log" ) type loggerContextKey struct{} func NewContext(ctx context.Context, logger log.Logger) context.Context { return context.WithValue(ctx, loggerContextKey{}, logger) } func...

用了一段时间自带的日志,感觉用zap的更方便一点

> > 用了一段时间自带的日志,感觉用zap的更方便一点 > > 如果都切走的话成本会不会有点高 代码里所有的日志替换为zap.Logger或者zap.SugaredLogger,程序启动的把zap logger注入到框架默认的全局日志

> Hi, @shcw! I'm Dosu, and I'm helping the kratos team manage their backlog. I wanted to let you know that we are marking this issue as stale.嗨,@shcw!我是 Dosu,我正在帮助 kratos...

> > 框架做这事不合适吧 这个是很常用的操作,或者单独提出一个包来