WarnServer 打印服务相关警告
(tag string, description string)
| 82 | |
| 83 | // WarnServer 打印服务相关警告 |
| 84 | func WarnServer(tag string, description string) { |
| 85 | if Tea.IsTesting() { |
| 86 | logs.Println("[" + tag + "]" + description) |
| 87 | } |
| 88 | |
| 89 | nodeConfig, _ := nodeconfigs.SharedNodeConfig() |
| 90 | if nodeConfig != nil && nodeConfig.GlobalServerConfig != nil && !nodeConfig.GlobalServerConfig.Log.RecordServerError { |
| 91 | return |
| 92 | } |
| 93 | |
| 94 | select { |
| 95 | case logChan <- &pb.NodeLog{ |
| 96 | Role: teaconst.Role, |
| 97 | Tag: tag, |
| 98 | Description: description, |
| 99 | Level: "warning", |
| 100 | NodeId: teaconst.NodeId, |
| 101 | CreatedAt: time.Now().Unix(), |
| 102 | }: |
| 103 | default: |
| 104 | |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // Error 打印错误信息 |
| 109 | func Error(tag string, description string) { |
no test coverage detected