diff options
Diffstat (limited to 'commands/account')
-rw-r--r-- | commands/account/compose.go | 4 | ||||
-rw-r--r-- | commands/account/export-mbox.go | 16 | ||||
-rw-r--r-- | commands/account/import-mbox.go | 16 | ||||
-rw-r--r-- | commands/account/recover.go | 4 | ||||
-rw-r--r-- | commands/account/search.go | 6 |
5 files changed, 23 insertions, 23 deletions
diff --git a/commands/account/compose.go b/commands/account/compose.go index 16474b4c..3d3d9afb 100644 --- a/commands/account/compose.go +++ b/commands/account/compose.go @@ -11,7 +11,7 @@ import ( "github.com/emersion/go-message/mail" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~sircmpwn/getopt" @@ -68,7 +68,7 @@ func (Compose) Execute(aerc *widgets.Aerc, args []string) error { ui.Invalidate() }) go func() { - defer logging.PanicHandler() + defer log.PanicHandler() composer.AppendContents(msg.Body) }() diff --git a/commands/account/export-mbox.go b/commands/account/export-mbox.go index f51608b9..cbb56e61 100644 --- a/commands/account/export-mbox.go +++ b/commands/account/export-mbox.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/widgets" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" "git.sr.ht/~rjarry/aerc/worker/types" @@ -55,7 +55,7 @@ func (ExportMbox) Execute(aerc *widgets.Aerc, args []string) error { go func() { file, err := os.Create(filename) if err != nil { - logging.Errorf("failed to create file: %v", err) + log.Errorf("failed to create file: %v", err) aerc.PushError(err.Error()) return } @@ -74,16 +74,16 @@ func (ExportMbox) Execute(aerc *widgets.Aerc, args []string) error { if retries > 0 { if retries > 10 { errorMsg := fmt.Sprintf("too many retries: %d; stopping export", retries) - logging.Errorf(errorMsg) + log.Errorf(errorMsg) aerc.PushError(args[0] + " " + errorMsg) break } sleeping := time.Duration(retries * 1e9 * 2) - logging.Debugf("sleeping for %s before retrying; retries: %d", sleeping, retries) + log.Debugf("sleeping for %s before retrying; retries: %d", sleeping, retries) time.Sleep(sleeping) } - logging.Debugf("fetching %d for export", len(uids)) + log.Debugf("fetching %d for export", len(uids)) acct.Worker().PostAction(&types.FetchFullMessages{ Uids: uids, }, func(msg types.WorkerMessage) { @@ -91,14 +91,14 @@ func (ExportMbox) Execute(aerc *widgets.Aerc, args []string) error { case *types.Done: done <- true case *types.Error: - logging.Errorf("failed to fetch message: %v", msg.Error) + log.Errorf("failed to fetch message: %v", msg.Error) aerc.PushError(args[0] + " error encountered: " + msg.Error.Error()) done <- false case *types.FullMessage: mu.Lock() err := mboxer.Write(file, msg.Content.Reader, "", t) if err != nil { - logging.Warnf("failed to write mbox: %v", err) + log.Warnf("failed to write mbox: %v", err) } for i, uid := range uids { if uid == msg.Content.Uid { @@ -117,7 +117,7 @@ func (ExportMbox) Execute(aerc *widgets.Aerc, args []string) error { } statusInfo := fmt.Sprintf("Exported %d of %d messages to %s.", ctr, len(store.Uids()), filename) aerc.PushStatus(statusInfo, 10*time.Second) - logging.Debugf(statusInfo) + log.Debugf(statusInfo) }() return nil diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 93408aca..7dab1958 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -11,7 +11,7 @@ import ( "time" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/widgets" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" @@ -55,7 +55,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { importFolder := func() { statusInfo := fmt.Sprintln("Importing", filename, "to folder", folder) aerc.PushStatus(statusInfo, 10*time.Second) - logging.Debugf(statusInfo) + log.Debugf(statusInfo) f, err := os.Open(filename) if err != nil { aerc.PushError(err.Error()) @@ -78,7 +78,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { var buf bytes.Buffer r, err := m.NewReader() if err != nil { - logging.Errorf("could not get reader for uid %d", m.UID()) + log.Errorf("could not get reader for uid %d", m.UID()) break } nbytes, _ := io.Copy(&buf, r) @@ -92,11 +92,11 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { switch msg := msg.(type) { case *types.Unsupported: errMsg := fmt.Sprintf("%s: AppendMessage is unsupported", args[0]) - logging.Errorf(errMsg) + log.Errorf(errMsg) aerc.PushError(errMsg) return case *types.Error: - logging.Errorf("AppendMessage failed: %v", msg.Error) + log.Errorf("AppendMessage failed: %v", msg.Error) done <- false case *types.Done: atomic.AddUint32(&appended, 1) @@ -113,17 +113,17 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { retries -= 1 sleeping := time.Duration((5 - retries) * 1e9) - logging.Debugf("sleeping for %s before append message %d again", sleeping, i) + log.Debugf("sleeping for %s before append message %d again", sleeping, i) time.Sleep(sleeping) } case <-time.After(30 * time.Second): - logging.Warnf("timed-out; appended %d of %d", appended, len(messages)) + log.Warnf("timed-out; appended %d of %d", appended, len(messages)) return } } } infoStr := fmt.Sprintf("%s: imported %d of %d sucessfully.", args[0], appended, len(messages)) - logging.Debugf(infoStr) + log.Debugf(infoStr) aerc.SetStatus(infoStr) } diff --git a/commands/account/recover.go b/commands/account/recover.go index b8acd261..9bb73316 100644 --- a/commands/account/recover.go +++ b/commands/account/recover.go @@ -9,7 +9,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~sircmpwn/getopt" @@ -114,7 +114,7 @@ func (Recover) Execute(aerc *widgets.Aerc, args []string) error { ui.Invalidate() }) go func() { - defer logging.PanicHandler() + defer log.PanicHandler() composer.AppendContents(bytes.NewReader(data)) }() diff --git a/commands/account/search.go b/commands/account/search.go index 125cb5d7..1494f788 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -6,7 +6,7 @@ import ( "git.sr.ht/~rjarry/aerc/lib/statusline" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/worker/types" ) @@ -44,7 +44,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { cb := func(msg types.WorkerMessage) { if _, ok := msg.(*types.Done); ok { acct.SetStatus(statusline.FilterResult(strings.Join(args, " "))) - logging.Tracef("Filter results: %v", store.Uids()) + log.Tracef("Filter results: %v", store.Uids()) } } store.Sort(store.GetCurrentSortCriteria(), cb) @@ -52,7 +52,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { acct.SetStatus(statusline.Search("Searching...")) cb := func(uids []uint32) { acct.SetStatus(statusline.Search(strings.Join(args, " "))) - logging.Tracef("Search results: %v", uids) + log.Tracef("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers ui.Invalidate() |