| | |
| | | package logc |
| | | |
| | | import ( |
| | | "basic.com/valib/bhomebus.git" |
| | | "basic.com/valib/bhshmq.git/proto/source/bhome_msg" |
| | | "basic.com/valib/c_bhomebus.git/proto/source/bhome_msg" |
| | | "fmt" |
| | | "sync" |
| | | "time" |
| | |
| | | deliverLog(log, timeout) |
| | | } |
| | | |
| | | func SaveRuleServerLog(ruleServerPushLog RuleServerPushLog, timeout time.Duration) { |
| | | deliverLog(&ruleServerPushLog, timeout) |
| | | } |
| | | |
| | | func deliverLog(l LogPrinter, timeout time.Duration) { |
| | | select { |
| | | case logCh <- l: |
| | |
| | | const ( |
| | | OperationLogTopic = "operationLogSaveTopic" |
| | | ScheduleLogTopic = "scheduleLogSaveTopic" |
| | | RuleServerLogTopic = "ruleServerLogSaveTopic" |
| | | ) |
| | | |
| | | func saveLoop(logCallback LogReportCallback, wg *sync.WaitGroup, done chan struct{}) { |
| | |
| | | if err != nil { |
| | | logger.Error("failed to Marshal", log) |
| | | } else { |
| | | var nodes []bhomebus.NetNode |
| | | nodes = append(nodes, bhomebus.NetNode{}) |
| | | var nodes []bhome_msg.BHAddress |
| | | nodes = append(nodes, bhome_msg.BHAddress{}) |
| | | |
| | | reg := &LogRegister { |
| | | nodes, |