aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/idler.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-06-07 21:34:34 +0200
committerRobin Jarry <robin@jarry.cc>2023-06-12 11:23:14 +0200
commit263d8cbec504bf56791dd3aa8c1e440d96b27d4a (patch)
tree4d358915e7ae2eed0850f4efb9b6dde5c3ddf0e2 /worker/imap/idler.go
parent1bd6612c78dc00fd04ef5d614d729e3c0ece7ac8 (diff)
downloadaerc-263d8cbec504bf56791dd3aa8c1e440d96b27d4a.tar.gz
logging: remove ultra verbose trace logs
Every message exchanged between the UI and the worker(s) is logged at least twice with some obscure IDs and struct pointer names. When enabling trace logging, this floods the files for very little or no benefit and makes the meaningful logging message hard to catch. Also, other messages tend to flood the output for no specific reason. These are most of the time leftovers from the development process and are not useful for tracking potential issues. Remove these. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'worker/imap/idler.go')
-rw-r--r--worker/imap/idler.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/worker/imap/idler.go b/worker/imap/idler.go
index e58cc6b9..30600764 100644
--- a/worker/imap/idler.go
+++ b/worker/imap/idler.go
@@ -82,12 +82,10 @@ func (i *idler) Start() {
select {
case <-i.stop:
// debounce idle
- i.log("=>(idle) [debounce]")
i.done <- nil
case <-time.After(i.config.idle_debounce):
// enter idle mode
i.setIdleing(true)
- i.log("=>(idle)")
now := time.Now()
err := i.client.Idle(i.stop,
&client.IdleOptions{
@@ -114,16 +112,11 @@ func (i *idler) Stop() error {
close(i.stop)
select {
case err := <-i.done:
- if err == nil {
- i.log("<=(idle)")
- } else {
+ if err != nil {
i.log("<=(idle) with err: %v", err)
}
reterr = nil
case <-time.After(i.config.idle_timeout):
- i.log("idle err (timeout); waiting in background")
-
- i.log("disconnect done->")
i.worker.PostMessage(&types.Done{
Message: types.RespondTo(&types.Disconnect{}),
}, nil)
@@ -133,10 +126,8 @@ func (i *idler) Stop() error {
reterr = errIdleTimeout
}
case i.isWaiting():
- i.log("not stopped: still idleing/hanging")
reterr = errIdleModeHangs
default:
- i.log("not stopped: client not ready")
reterr = nil
}
return reterr
@@ -144,13 +135,10 @@ func (i *idler) Stop() error {
func (i *idler) waitOnIdle() {
i.setWaiting(true)
- i.log("wait for idle in background")
go func() {
defer log.PanicHandler()
err := <-i.done
if err == nil {
- i.log("<=(idle) waited")
- i.log("connect done->")
i.worker.PostMessage(&types.Done{
Message: types.RespondTo(&types.Connect{}),
}, nil)
@@ -159,7 +147,6 @@ func (i *idler) waitOnIdle() {
}
i.setWaiting(false)
i.stop = make(chan struct{})
- i.log("restart")
i.Start()
}()
}