aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/account/compose.go4
-rw-r--r--commands/account/export-mbox.go16
-rw-r--r--commands/account/import-mbox.go16
-rw-r--r--commands/account/recover.go4
-rw-r--r--commands/account/search.go6
-rw-r--r--commands/compose/attach.go23
-rw-r--r--commands/compose/postpone.go8
-rw-r--r--commands/compose/send.go8
-rw-r--r--commands/exec.go4
-rw-r--r--commands/history.go4
-rw-r--r--commands/msg/archive.go4
-rw-r--r--commands/msg/envelope.go4
-rw-r--r--commands/msg/forward.go14
-rw-r--r--commands/msg/invite.go4
-rw-r--r--commands/msg/pipe.go10
-rw-r--r--commands/msg/recall.go10
-rw-r--r--commands/msg/reply.go10
-rw-r--r--commands/msg/unsubscribe.go6
-rw-r--r--commands/msgview/save.go4
-rw-r--r--commands/util.go4
20 files changed, 81 insertions, 82 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()
diff --git a/commands/compose/attach.go b/commands/compose/attach.go
index de83ef0b..62ae0291 100644
--- a/commands/compose/attach.go
+++ b/commands/compose/attach.go
@@ -12,7 +12,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/widgets"
"github.com/mitchellh/go-homedir"
)
@@ -47,24 +47,24 @@ func (a Attach) Execute(aerc *widgets.Aerc, args []string) error {
func (a Attach) addPath(aerc *widgets.Aerc, path string) error {
path, err := homedir.Expand(path)
if err != nil {
- logging.Errorf("failed to expand path '%s': %v", path, err)
+ log.Errorf("failed to expand path '%s': %v", path, err)
aerc.PushError(err.Error())
return err
}
attachments, err := filepath.Glob(path)
if err != nil && errors.Is(err, filepath.ErrBadPattern) {
- logging.Warnf("failed to parse as globbing pattern: %v", err)
+ log.Warnf("failed to parse as globbing pattern: %v", err)
attachments = []string{path}
}
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
for _, attach := range attachments {
- logging.Debugf("attaching '%s'", attach)
+ log.Debugf("attaching '%s'", attach)
pathinfo, err := os.Stat(attach)
if err != nil {
- logging.Errorf("failed to stat file: %v", err)
+ log.Errorf("failed to stat file: %v", err)
aerc.PushError(err.Error())
return err
} else if pathinfo.IsDir() && len(attachments) == 1 {
@@ -113,23 +113,23 @@ func (a Attach) openMenu(aerc *widgets.Aerc, args []string) error {
t.OnClose = func(err error) {
defer func() {
if err := picks.Close(); err != nil {
- logging.Errorf("error closing file: %v", err)
+ log.Errorf("error closing file: %v", err)
}
if err := os.Remove(picks.Name()); err != nil {
- logging.Errorf("could not remove tmp file: %v", err)
+ log.Errorf("could not remove tmp file: %v", err)
}
}()
aerc.CloseDialog()
if err != nil {
- logging.Errorf("terminal closed with error: %v", err)
+ log.Errorf("terminal closed with error: %v", err)
return
}
_, err = picks.Seek(0, io.SeekStart)
if err != nil {
- logging.Errorf("seek failed: %v", err)
+ log.Errorf("seek failed: %v", err)
return
}
@@ -139,11 +139,10 @@ func (a Attach) openMenu(aerc *widgets.Aerc, args []string) error {
if _, err := os.Stat(f); err != nil {
continue
}
- logging.Tracef("File picker attaches: %v", f)
+ log.Tracef("File picker attaches: %v", f)
err := a.addPath(aerc, f)
if err != nil {
- logging.Errorf(
- "attach failed for file %s: %v", f, err)
+ log.Errorf("attach failed for file %s: %v", f, err)
}
}
diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go
index 2572d8d5..eb7bc0a3 100644
--- a/commands/compose/postpone.go
+++ b/commands/compose/postpone.go
@@ -7,7 +7,7 @@ import (
"github.com/miolini/datacounter"
"github.com/pkg/errors"
- "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/~rjarry/aerc/worker/types"
@@ -47,7 +47,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
return errors.New("No Postpone location configured")
}
- logging.Tracef("Postponing mail")
+ log.Tracef("Postponing mail")
header, err := composer.PrepareHeader()
if err != nil {
@@ -70,7 +70,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
// run this as a goroutine so we can make other progress. The message
// will be saved once the directory is created.
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
errStr := <-errChan
if errStr != "" {
@@ -80,7 +80,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error {
handleErr := func(err error) {
aerc.PushError(err.Error())
- logging.Errorf("Postponing failed: %v", err)
+ log.Errorf("Postponing failed: %v", err)
aerc.NewTab(composer, tabName)
}
diff --git a/commands/compose/send.go b/commands/compose/send.go
index ccfe7886..6d9bfe25 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -17,7 +17,7 @@ import (
"git.sr.ht/~rjarry/aerc/commands/mode"
"git.sr.ht/~rjarry/aerc/lib"
- "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/~rjarry/aerc/worker/types"
@@ -104,7 +104,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
if err != nil || warn {
msg := "You may have forgotten an attachment."
if err != nil {
- logging.Warnf("failed to check for a forgotten attachment: %v", err)
+ log.Warnf("failed to check for a forgotten attachment: %v", err)
msg = "Failed to check for a forgotten attachment."
}
@@ -148,7 +148,7 @@ func send(aerc *widgets.Aerc, composer *widgets.Composer, ctx sendCtx,
failCh := make(chan error)
// writer
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
var sender io.WriteCloser
var err error
@@ -182,7 +182,7 @@ func send(aerc *widgets.Aerc, composer *widgets.Composer, ctx sendCtx,
// cleanup + copy to sent
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
// leave no-quit mode
defer mode.NoQuitDone()
diff --git a/commands/exec.go b/commands/exec.go
index 8757a51a..37274116 100644
--- a/commands/exec.go
+++ b/commands/exec.go
@@ -7,7 +7,7 @@ import (
"os/exec"
"time"
- "git.sr.ht/~rjarry/aerc/logging"
+ "git.sr.ht/~rjarry/aerc/log"
"git.sr.ht/~rjarry/aerc/widgets"
)
@@ -46,7 +46,7 @@ func (ExecCmd) Execute(aerc *widgets.Aerc, args []string) error {
cmd.Env = env
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
err := cmd.Run()
if err != nil {
diff --git a/commands/history.go b/commands/history.go
index 5cc0bfb3..7aa42fab 100644
--- a/commands/history.go
+++ b/commands/history.go
@@ -9,7 +9,7 @@ import (
"path"
"sync"
- "git.sr.ht/~rjarry/aerc/logging"
+ "git.sr.ht/~rjarry/aerc/log"
"github.com/kyoh86/xdg"
)
@@ -105,7 +105,7 @@ func (h *cmdHistory) initialize() {
0o600,
)
if err != nil {
- logging.Errorf("failed to open history file: %v", err)
+ log.Errorf("failed to open history file: %v", err)
// basically mirror the old behavior
h.histfile = bytes.NewBuffer([]byte{})
return
diff --git a/commands/msg/archive.go b/commands/msg/archive.go
index b0c7b038..149d7a5f 100644
--- a/commands/msg/archive.go
+++ b/commands/msg/archive.go
@@ -7,7 +7,7 @@ import (
"sync"
"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"
"git.sr.ht/~rjarry/aerc/worker/types"
@@ -101,7 +101,7 @@ func (Archive) Execute(aerc *widgets.Aerc, args []string) error {
}
// we need to do that in the background, else we block the main thread
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
wg.Wait()
if success {
diff --git a/commands/msg/envelope.go b/commands/msg/envelope.go
index 616798d8..1b16d16f 100644
--- a/commands/msg/envelope.go
+++ b/commands/msg/envelope.go
@@ -6,7 +6,7 @@ import (
"strings"
"git.sr.ht/~rjarry/aerc/lib/format"
- "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"
@@ -127,7 +127,7 @@ func parseHeader(msg *models.MessageInfo, fmtStr string) (result []string) {
for hf.Next() {
text, err := hf.Text()
if err != nil {
- logging.Errorf(err.Error())
+ log.Errorf(err.Error())
text = hf.Value()
}
result = append(result,
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index 74ee6575..c0215aee 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -15,7 +15,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/format"
"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/~rjarry/aerc/worker/types"
@@ -74,7 +74,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
if err != nil {
return err
}
- logging.Debugf("Forwarding email <%s>", msg.Envelope.MessageId)
+ log.Debugf("Forwarding email <%s>", msg.Envelope.MessageId)
h := &mail.Header{}
subject := "Fwd: " + msg.Envelope.Subject
@@ -133,10 +133,10 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
tmpFile, err := os.Create(tmpFileName)
if err != nil {
- logging.Warnf("failed to create temporary attachment: %v", err)
+ log.Warnf("failed to create temporary attachment: %v", err)
_, err = addTab()
if err != nil {
- logging.Warnf("failed to add tab: %v", err)
+ log.Warnf("failed to add tab: %v", err)
}
return
}
@@ -144,7 +144,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
defer tmpFile.Close()
_, err = io.Copy(tmpFile, fm.Content.Reader)
if err != nil {
- logging.Warnf("failed to write to tmpfile: %v", err)
+ log.Warnf("failed to write to tmpfile: %v", err)
return
}
composer, err := addTab()
@@ -194,7 +194,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
}
bs, err := msg.BodyStructure.PartAtIndex(p)
if err != nil {
- logging.Errorf("cannot get PartAtIndex %v: %v", p, err)
+ log.Errorf("cannot get PartAtIndex %v: %v", p, err)
continue
}
store.FetchBodyPart(msg.Uid, p, func(reader io.Reader) {
@@ -208,7 +208,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
err := composer.AddPartAttachment(name, mime, params, reader)
mu.Unlock()
if err != nil {
- logging.Errorf(err.Error())
+ log.Errorf(err.Error())
aerc.PushError(err.Error())
}
})
diff --git a/commands/msg/invite.go b/commands/msg/invite.go
index 4b2507f4..32251643 100644
--- a/commands/msg/invite.go
+++ b/commands/msg/invite.go
@@ -9,7 +9,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib/calendar"
"git.sr.ht/~rjarry/aerc/lib/format"
"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"
"github.com/emersion/go-message/mail"
@@ -187,7 +187,7 @@ func (invite) Execute(aerc *widgets.Aerc, args []string) error {
} else {
err := addTab(cr)
if err != nil {
- logging.Warnf("failed to add tab: %v", err)
+ log.Warnf("failed to add tab: %v", err)
}
}
})
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go
index 4a5a6168..878fd18c 100644
--- a/commands/msg/pipe.go
+++ b/commands/msg/pipe.go
@@ -10,7 +10,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/widgets"
mboxer "git.sr.ht/~rjarry/aerc/worker/mbox"
"git.sr.ht/~rjarry/aerc/worker/types"
@@ -92,12 +92,12 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
return
}
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
defer pipe.Close()
_, err := io.Copy(pipe, reader)
if err != nil {
- logging.Errorf("failed to send data to pipe: %v", err)
+ log.Errorf("failed to send data to pipe: %v", err)
}
}()
err = ecmd.Run()
@@ -166,7 +166,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
})
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
select {
case <-done:
@@ -245,7 +245,7 @@ func newMessagesReader(messages []*types.FullMessage, useMbox bool) io.Reader {
_, err = io.Copy(pw, msg.Content.Reader)
}
if err != nil {
- logging.Warnf("failed to write data: %v", err)
+ log.Warnf("failed to write data: %v", err)
}
}
}()
diff --git a/commands/msg/recall.go b/commands/msg/recall.go
index eb8195f8..d39f4daf 100644
--- a/commands/msg/recall.go
+++ b/commands/msg/recall.go
@@ -14,7 +14,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"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/~rjarry/aerc/worker/types"
@@ -70,7 +70,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
if err != nil {
return errors.Wrap(err, "Recall failed")
}
- logging.Debugf("Recalling message <%s>", msgInfo.Envelope.MessageId)
+ log.Debugf("Recalling message <%s>", msgInfo.Envelope.MessageId)
composer, err := widgets.NewComposer(aerc, acct, aerc.Config(),
acct.AccountConfig(), acct.Worker(), "", msgInfo.RFC822Headers,
@@ -185,7 +185,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
if md.IsSigned {
err = composer.SetSign(md.IsSigned)
if err != nil {
- logging.Warnf("failed to set signed state: %v", err)
+ log.Warnf("failed to set signed state: %v", err)
}
}
}
@@ -200,7 +200,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
}
bs, err := msg.BodyStructure().PartAtIndex(p)
if err != nil {
- logging.Warnf("cannot get PartAtIndex %v: %v", p, err)
+ log.Warnf("cannot get PartAtIndex %v: %v", p, err)
continue
}
msg.FetchBodyPart(p, func(reader io.Reader) {
@@ -214,7 +214,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
err := composer.AddPartAttachment(name, mime, params, reader)
mu.Unlock()
if err != nil {
- logging.Errorf(err.Error())
+ log.Errorf(err.Error())
aerc.PushError(err.Error())
}
})
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index bd57f4b1..066eaca3 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -14,7 +14,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib/crypto"
"git.sr.ht/~rjarry/aerc/lib/format"
"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"
"github.com/emersion/go-message/mail"
@@ -226,12 +226,12 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
buf := new(bytes.Buffer)
_, err := buf.ReadFrom(reader)
if err != nil {
- logging.Warnf("failed to fetch bodypart: %v", err)
+ log.Warnf("failed to fetch bodypart: %v", err)
}
original.Text = buf.String()
err = addTab()
if err != nil {
- logging.Warnf("failed to add tab: %v", err)
+ log.Warnf("failed to add tab: %v", err)
}
})
return nil
@@ -254,12 +254,12 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
buf := new(bytes.Buffer)
_, err := buf.ReadFrom(reader)
if err != nil {
- logging.Warnf("failed to fetch bodypart: %v", err)
+ log.Warnf("failed to fetch bodypart: %v", err)
}
original.Text = buf.String()
err = addTab()
if err != nil {
- logging.Warnf("failed to add tab: %v", err)
+ log.Warnf("failed to add tab: %v", err)
}
})
return nil
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index 72c839fe..0538b2f2 100644
--- a/commands/msg/unsubscribe.go
+++ b/commands/msg/unsubscribe.go
@@ -10,7 +10,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"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"
"github.com/emersion/go-message/mail"
@@ -56,10 +56,10 @@ func (Unsubscribe) Execute(aerc *widgets.Aerc, args []string) error {
if len(methods) == 0 {
return fmt.Errorf("no methods found to unsubscribe")
}
- logging.Debugf("unsubscribe: found %d methods", len(methods))
+ log.Debugf("unsubscribe: found %d methods", len(methods))
unsubscribe := func(method *url.URL) {
- logging.Debugf("unsubscribe: trying to unsubscribe using %s", method.Scheme)
+ log.Debugf("unsubscribe: trying to unsubscribe using %s", method.Scheme)
var err error
switch strings.ToLower(method.Scheme) {
case "mailto":
diff --git a/commands/msgview/save.go b/commands/msgview/save.go
index 4820ec0f..3cb48c2b 100644
--- a/commands/msgview/save.go
+++ b/commands/msgview/save.go
@@ -13,7 +13,7 @@ import (
"github.com/mitchellh/go-homedir"
"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"
)
@@ -164,7 +164,7 @@ func savePart(
// we need to wait for the callback prior to displaying a result
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
err := <-ch
if err != nil {
diff --git a/commands/util.go b/commands/util.go
index b14e9690..fe0b2756 100644
--- a/commands/util.go
+++ b/commands/util.go
@@ -13,7 +13,7 @@ import (
"github.com/lithammer/fuzzysearch/fuzzy"
"git.sr.ht/~rjarry/aerc/lib"
- "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/~rjarry/aerc/worker/types"
@@ -53,7 +53,7 @@ func QuickTerm(aerc *widgets.Aerc, args []string, stdin io.Reader) (*widgets.Ter
status := make(chan error, 1)
go func() {
- defer logging.PanicHandler()
+ defer log.PanicHandler()
_, err := io.Copy(pipe, stdin)
defer pipe.Close()