{"repo":"itmisx/logx","free":true,"listed":false,"github":"https://github.com/itmisx/logx","clone":"git clone https://github.com/itmisx/logx.git","description":"基于opentelemetry及zap实现的日志记录及追踪","language":"Go","stars":17,"topics":["log","trace","loki","tempo","grafana"],"license":"MIT","category":"analytics","readme_excerpt":"logger logger logger wraps uber/zap and trace with opentelemetry Feature - [x] 支持日志及切分 - [x] 支持追踪（基于 opentelemetry ） - [x] 支持 Debug,Info,Warn,Error,Fatal 日志等级 - [x] 支持异常自动恢复 defer logger.End(ctx) Install Usage - 配置项 - 初始化 基础使用 追踪传递，就是传递 traceID 和 spanID gin 框架实例 手动传递 functions - Init(conf Config,applicationAttributes ...logger.Field) //初始化，配置及应用信息 - Start(ctx context.Context,spanName string,spanStartOption ...logger.Field) context.Context //启动日志追踪,spanName 为追踪跨度的名称，spanStartOption 为跨度额外信息 - Info(ctx context.Context,msg string,attributes ...logger.Field) // 普通日志 - Warn(ctx context.Context,msg string,attributes ...logger.Field) // 警告日志 - Error(ctx context.Context,msg string,attributes ...logger.Field) // 错误日志 - End(ctx context.Context) //结束日志追踪 - TraceID(ctx context.Context)string //获取 traceID - SpanID(ctx context.Context)string //获取 spanID - GenTraceID()string // 生成 traceID - GenSpanID()string // 生成 spanID logger.Field 类型支持 - bool - boolSlice - int - intSlice - int64 - int64Slice - float64 - float64Slice - string - stringSlice - stringer, interface{String()string{}} 基于 loki+tempo+grafana 的效果（日志查询+追踪） License Use of logger is governed by the Mit License","default_branch":null,"files":null,"tree":[],"storefront":"/r/itmisx","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/itmisx/logx/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}