]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-caller/main.go
recfile log format
[nncp.git] / src / cmd / nncp-caller / main.go
index f7ab13c23299cc301608920776df84f417266042..b702b498038ca4eeb04a4e01b29e372ea70e83f4 100644 (file)
@@ -86,7 +86,7 @@ func main() {
                                log.Fatalln("Invalid NODE specified:", err)
                        }
                        if len(node.Calls) == 0 {
-                               ctx.LogD("caller", nncp.SDS{"node": node.Id}, "has no calls, skipping")
+                               ctx.LogD("caller", nncp.LEs{{K: "Node", V: node.Id}}, "has no calls, skipping")
                                continue
                        }
                        nodes = append(nodes, node)
@@ -94,7 +94,7 @@ func main() {
        } else {
                for _, node := range ctx.Neigh {
                        if len(node.Calls) == 0 {
-                               ctx.LogD("caller", nncp.SDS{"node": node.Id}, "has no calls, skipping")
+                               ctx.LogD("caller", nncp.LEs{{K: "Node", V: node.Id}}, "has no calls, skipping")
                                continue
                        }
                        nodes = append(nodes, node)
@@ -115,27 +115,27 @@ func main() {
                                } else {
                                        addrs = append(addrs, *call.Addr)
                                }
-                               sds := nncp.SDS{"node": node.Id, "callindex": i}
+                               les := nncp.LEs{{K: "Node", V: node.Id}, {K: "CallIndex", V: i}}
                                for {
                                        n := time.Now()
                                        t := call.Cron.Next(n)
-                                       ctx.LogD("caller", sds, t.String())
+                                       ctx.LogD("caller", les, t.String())
                                        if t.IsZero() {
-                                               ctx.LogE("caller", sds, errors.New("got zero time"), "")
+                                               ctx.LogE("caller", les, errors.New("got zero time"), "")
                                                return
                                        }
                                        time.Sleep(t.Sub(n))
                                        node.Lock()
                                        if node.Busy {
                                                node.Unlock()
-                                               ctx.LogD("caller", sds, "busy")
+                                               ctx.LogD("caller", les, "busy")
                                                continue
                                        } else {
                                                node.Busy = true
                                                node.Unlock()
 
                                                if call.WhenTxExists && call.Xx != "TRx" {
-                                                       ctx.LogD("caller", sds, "checking tx existence")
+                                                       ctx.LogD("caller", les, "checking tx existence")
                                                        txExists := false
                                                        for job := range ctx.Jobs(node.Id, nncp.TTx) {
                                                                job.Fd.Close()
@@ -145,7 +145,7 @@ func main() {
                                                                txExists = true
                                                        }
                                                        if !txExists {
-                                                               ctx.LogD("caller", sds, "no tx")
+                                                               ctx.LogD("caller", les, "no tx")
                                                                node.Lock()
                                                                node.Busy = false
                                                                node.Unlock()