本文整理汇总了Golang中go/uber/org/zap.Logger类的典型用法代码示例。如果您正苦于以下问题:Golang Logger类的具体用法?Golang Logger怎么用?Golang Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Logger类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: WithLogger
func (s *Store) WithLogger(log zap.Logger) {
s.baseLogger = log
s.Logger = log.With(zap.String("service", "store"))
for _, sh := range s.shards {
sh.WithLogger(s.baseLogger)
}
}
开发者ID:li-ang,项目名称:influxdb,代码行数:7,代码来源:store.go
示例2: WithLogger
func (l *WAL) WithLogger(log zap.Logger) {
l.logger = log.With(zap.String("service", "wal"))
if l.traceLogging {
l.traceLogger = l.logger
}
}
开发者ID:li-ang,项目名称:influxdb,代码行数:7,代码来源:wal.go
示例3: WithLogger
func (f *FileStore) WithLogger(log zap.Logger) {
f.logger = log.With(zap.String("service", "filestore"))
f.purger.logger = f.logger
if f.traceLogging {
f.traceLogger = f.logger
}
}
开发者ID:li-ang,项目名称:influxdb,代码行数:8,代码来源:file_store.go
示例4: WithLogger
func (e *Engine) WithLogger(log zap.Logger) {
e.logger = log.With(zap.String("engine", "tsm1"))
if e.traceLogging {
e.traceLogger = e.logger
}
e.WAL.WithLogger(e.logger)
e.FileStore.WithLogger(e.logger)
}
开发者ID:li-ang,项目名称:influxdb,代码行数:10,代码来源:engine.go
示例5: WithLogger
func (s *Service) WithLogger(log zap.Logger) {
s.Logger = log.With(zap.String("service", "collectd"))
}
开发者ID:li-ang,项目名称:influxdb,代码行数:3,代码来源:service.go
示例6: WithLogger
func (m *Monitor) WithLogger(log zap.Logger) {
m.Logger = log.With(zap.String("service", "monitor"))
}
开发者ID:li-ang,项目名称:influxdb,代码行数:3,代码来源:service.go
示例7: WithLogger
// SetLogOutput sets the writer to which all logs are written. It must not be
// called after Open is called.
func (e *QueryExecutor) WithLogger(log zap.Logger) {
e.Logger = log.With(zap.String("service", "query"))
e.TaskManager.Logger = e.Logger
}
开发者ID:li-ang,项目名称:influxdb,代码行数:6,代码来源:query_executor.go
示例8: WithLogger
func (c *Client) WithLogger(log zap.Logger) {
c.mu.Lock()
defer c.mu.Unlock()
c.logger = log.With(zap.String("service", "metaclient"))
}
开发者ID:li-ang,项目名称:influxdb,代码行数:5,代码来源:client.go
示例9: WithLogger
func (cl *CacheLoader) WithLogger(log zap.Logger) {
cl.Logger = log.With(zap.String("service", "cacheloader"))
}
开发者ID:li-ang,项目名称:influxdb,代码行数:3,代码来源:cache.go
示例10: WithLogger
func (w *PointsWriter) WithLogger(log zap.Logger) {
w.Logger = log.With(zap.String("service", "write"))
}
开发者ID:li-ang,项目名称:influxdb,代码行数:3,代码来源:points_writer.go
注:本文中的go/uber/org/zap.Logger类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论