Browse Source

Merge pull request 'prune logging' (#2) from logprune into trunk

Reviewed-on: https://git.openprivacy.ca/cwtch.im/libcwtch-go/pulls/2
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
reportACNErr
Sarah Jamie Lewis 4 months ago
parent
commit
2bf1adb47c
  1. 7
      lib.go
  2. 2
      utils/eventHandler.go
  3. 1
      utils/manager.go

7
lib.go

@ -230,10 +230,10 @@ func SendAppEvent(eventJson string) {
// rest of the logic nicer.
var new_event event.Event
json.Unmarshal([]byte(eventJson), &new_event)
log.Infof("Event: %v", new_event)
log.Debugf("Event: %v", new_event.EventType)
// We need to update the local cache
// Ideally I think this would be pusgit hed back into Cwtch
// Ideally I think this would be pushed back into Cwtch
switch new_event.EventType {
case utils.UpdateGlobalSettings:
var globalSettings utils.GlobalSettings
@ -347,7 +347,6 @@ func c_GetAppBusEvent() *C.char {
// GetAppBusEvent blocks until an event
func GetAppBusEvent() string {
log.Debugf("appbusevent called")
for eventHandler == nil {
log.Debugf("waiting for eventHandler != nil")
time.Sleep(time.Second)
@ -355,10 +354,8 @@ func GetAppBusEvent() string {
var json = ""
for json == "" {
log.Debugf("waiting for json != ''")
json = eventHandler.GetNextEvent()
}
log.Debugf("appbusevent: %v", json)
return json
}

2
utils/eventHandler.go

@ -362,7 +362,7 @@ func (eh *EventHandler) startHandlingPeer(onion string) {
}
func (eh *EventHandler) forwardProfileMessages(onion string, q event.Queue) {
log.Infof("Launching Forwarding Goroutine for %v", onion)
log.Infof("Launching Forwarding Goroutine")
// TODO: graceful shutdown, via an injected event of special QUIT type exiting loop/go routine
for {
e := q.Next()

1
utils/manager.go

@ -247,7 +247,6 @@ func NewManager(profile string, gcd *GrandCentralDispatcher) Manager {
// uiManager.AddContact(onion)
// (handle string, displayName string, image string, badge int, status int, authorization string, loading bool, lastMsgTime int)
func EnrichNewPeer(handle string, ph *PeerHelper, ev *EventProfileEnvelope) error {
log.Infof("Enriching New Peer %v", handle)
if ph.IsGroup(handle) {
group := ph.peer.GetGroup(handle)
if group != nil {

Loading…
Cancel
Save