Error 打印错误信息
(tag string, description string)
| 107 | |
| 108 | // Error 打印错误信息 |
| 109 | func Error(tag string, description string) { |
| 110 | logs.Println("[" + tag + "]" + description) |
| 111 | |
| 112 | // 忽略RPC连接错误 |
| 113 | var level = "error" |
| 114 | if strings.Contains(description, "code = Unavailable desc") { |
| 115 | level = "warning" |
| 116 | } |
| 117 | |
| 118 | select { |
| 119 | case logChan <- &pb.NodeLog{ |
| 120 | Role: teaconst.Role, |
| 121 | Tag: tag, |
| 122 | Description: description, |
| 123 | Level: level, |
| 124 | NodeId: teaconst.NodeId, |
| 125 | CreatedAt: time.Now().Unix(), |
| 126 | }: |
| 127 | default: |
| 128 | |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | // ErrorServer 打印服务相关错误信息 |
| 133 | func ErrorServer(tag string, description string) { |
no test coverage detected