projects
/
svn42.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more proper import
[svn42.git]
/
go
/
r3-netstatus
/
main.go
diff --git
a/go/r3-netstatus/main.go
b/go/r3-netstatus/main.go
index
b65e96e
..
0af7ef8
100644
(file)
--- a/
go/r3-netstatus/main.go
+++ b/
go/r3-netstatus/main.go
@@
-9,7
+9,7
@@
import (
"time"
"fmt"
//~ "./brain"
"time"
"fmt"
//~ "./brain"
- r3events "svn.spreadspace.org/realraum/go.svn/r3-eventbroker_zmq/r3events"
+ r3events "svn.spreadspace.org/realraum/go.svn/r3events"
)
type SpaceState struct {
)
type SpaceState struct {
@@
-42,8
+42,6
@@
func init() {
flag.BoolVar(&enable_syslog_, "syslog", false, "enable logging to syslog")
flag.BoolVar(&enable_debug_, "debug", false, "enable debug logging")
flag.Parse()
flag.BoolVar(&enable_syslog_, "syslog", false, "enable logging to syslog")
flag.BoolVar(&enable_debug_, "debug", false, "enable debug logging")
flag.Parse()
- if enable_syslog_ { LogEnableSyslog(); r3xmppbot.LogEnableSyslog() }
- if enable_debug_ { LogEnableDebuglog(); r3xmppbot.LogEnableDebuglog() }
}
//-------
}
//-------
@@
-119,7
+117,17
@@
func EventToXMPP(ps *pubsub.PubSub, xmpp_presence_events_chan_ chan <- interface
}
}
}
}
+func ParseZMQr3Event(lines [][]byte, ps *pubsub.PubSub) {
+ evnt, pubsubcat, err := r3events.UnmarshalByteByte2Event(lines)
+ if err != nil { return }
+ ps.Pub(evnt, pubsubcat)
+}
+
func main() {
func main() {
+ if enable_syslog_ { LogEnableSyslog(); r3xmppbot.LogEnableSyslog() }
+ if enable_debug_ { LogEnableDebuglog(); r3xmppbot.LogEnableDebuglog() }
+ Syslog_.Print("started")
+ defer Syslog_.Print("exiting")
zmqctx, zmqsub := ZmqsInit(r3eventssub_port_)
defer zmqctx.Close()
if zmqsub != nil {defer zmqsub.Close()}
zmqctx, zmqsub := ZmqsInit(r3eventssub_port_)
defer zmqctx.Close()
if zmqsub != nil {defer zmqsub.Close()}
@@
-143,7
+151,7
@@
func main() {
} else {
fmt.Println(xmpperr)
fmt.Println("XMPP Bot disabled")
} else {
fmt.Println(xmpperr)
fmt.Println("XMPP Bot disabled")
- Syslog_.Printf("XMPP Bot disabled due to error: %s", xmpperr)
+ Syslog_.Printf("XMPP Bot disabled due to error: %s", xmpperr.Error())
}
// --- get update on most recent events ---
}
// --- get update on most recent events ---