From 8edf7b0e4d386e5b4b4f052c88a781e40b1f1d30 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 13 Feb 2024 22:44:25 +0100 Subject: log: move package to lib This has nothing to do at the root of the source tree. Signed-off-by: Robin Jarry Acked-by: Bence Ferdinandy --- app/account-wizard.go | 2 +- app/account.go | 2 +- app/aerc.go | 2 +- app/compose.go | 2 +- app/dirlist.go | 2 +- app/dirtree.go | 2 +- app/listbox.go | 2 +- app/msglist.go | 2 +- app/msgviewer.go | 2 +- app/spinner.go | 2 +- app/status.go | 2 +- app/terminal.go | 2 +- commands/account/export-mbox.go | 2 +- commands/account/import-mbox.go | 2 +- commands/account/search.go | 2 +- commands/commands.go | 2 +- commands/completion_helpers.go | 2 +- commands/compose/attach.go | 2 +- commands/compose/postpone.go | 2 +- commands/compose/send.go | 2 +- commands/exec.go | 2 +- commands/history.go | 2 +- commands/menu.go | 2 +- commands/msg/archive.go | 2 +- commands/msg/bounce.go | 2 +- commands/msg/copy.go | 2 +- commands/msg/envelope.go | 2 +- commands/msg/forward.go | 2 +- commands/msg/invite.go | 2 +- commands/msg/move.go | 2 +- commands/msg/pipe.go | 2 +- commands/msg/recall.go | 2 +- commands/msg/reply.go | 2 +- commands/msg/unsubscribe.go | 2 +- commands/msgview/open-link.go | 2 +- commands/msgview/open.go | 2 +- commands/msgview/save.go | 2 +- commands/patch/apply.go | 2 +- commands/patch/drop.go | 2 +- commands/patch/rebase.go | 2 +- commands/patch/switch.go | 2 +- commands/patch/unlink.go | 2 +- commands/util.go | 2 +- completer/completer.go | 2 +- config/accounts.go | 2 +- config/binds.go | 2 +- config/compose.go | 2 +- config/converters.go | 2 +- config/filters.go | 2 +- config/general.go | 2 +- config/hooks.go | 2 +- config/openers.go | 2 +- config/statusline.go | 2 +- config/templates.go | 2 +- config/ui.go | 2 +- config/viewer.go | 2 +- lib/attachment.go | 2 +- lib/crypto/crypto.go | 2 +- lib/crypto/gpg/gpgbin/gpgbin.go | 2 +- lib/crypto/pgp/pgp.go | 2 +- lib/hooks/exec.go | 2 +- lib/ipc/receive.go | 2 +- lib/log/logger.go | 152 ++++++++++++++++++++++++++++++++ lib/log/panic-logger.go | 60 +++++++++++++ lib/messageview.go | 2 +- lib/open.go | 2 +- lib/pama/apply.go | 2 +- lib/pama/drop.go | 2 +- lib/pama/list.go | 2 +- lib/pama/models/view.go | 2 +- lib/pama/revctrl/git.go | 2 +- lib/pama/revctrl/revctrl.go | 2 +- lib/pama/store/store.go | 2 +- lib/pama/unlink.go | 2 +- lib/pama/worktree.go | 2 +- lib/parse/ansi.go | 2 +- lib/parse/daterange.go | 2 +- lib/parse/header.go | 2 +- lib/parse/match.go | 2 +- lib/rfc822/message.go | 2 +- lib/state/templates.go | 2 +- lib/threadbuilder.go | 2 +- lib/ui/textinput.go | 2 +- lib/ui/ui.go | 2 +- lib/watchers/fsevents.go | 2 +- lib/watchers/inotify.go | 2 +- lib/xdg/home.go | 2 +- log/logger.go | 152 -------------------------------- log/panic-logger.go | 60 ------------- main.go | 2 +- worker/imap/cache.go | 2 +- worker/imap/connect.go | 2 +- worker/imap/extensions/xgmext/client.go | 2 +- worker/imap/fetch.go | 2 +- worker/imap/flags.go | 2 +- worker/imap/idler.go | 2 +- worker/imap/list.go | 2 +- worker/imap/observer.go | 2 +- worker/jmap/cache/cache.go | 2 +- worker/jmap/cache/folder_contents.go | 2 +- worker/jmap/push.go | 2 +- worker/jmap/send.go | 2 +- worker/lib/search.go | 2 +- worker/maildir/container.go | 2 +- worker/maildir/message.go | 2 +- worker/maildir/search.go | 2 +- worker/maildir/worker.go | 2 +- worker/mbox/worker.go | 2 +- worker/notmuch/eventhandlers.go | 2 +- worker/notmuch/lib/database.go | 2 +- worker/notmuch/message.go | 2 +- worker/notmuch/worker.go | 2 +- worker/types/thread.go | 2 +- worker/types/worker.go | 2 +- 114 files changed, 322 insertions(+), 322 deletions(-) create mode 100644 lib/log/logger.go create mode 100644 lib/log/panic-logger.go delete mode 100644 log/logger.go delete mode 100644 log/panic-logger.go diff --git a/app/account-wizard.go b/app/account-wizard.go index 36bc0392..9c216a19 100644 --- a/app/account-wizard.go +++ b/app/account-wizard.go @@ -18,9 +18,9 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/format" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rockorager/vaxis" ) diff --git a/app/account.go b/app/account.go index 4b5fa30b..2bdf970a 100644 --- a/app/account.go +++ b/app/account.go @@ -10,12 +10,12 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/hooks" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/marker" "git.sr.ht/~rjarry/aerc/lib/sort" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/templates" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker" "git.sr.ht/~rjarry/aerc/worker/types" diff --git a/app/aerc.go b/app/aerc.go index fd36b72b..97604b17 100644 --- a/app/aerc.go +++ b/app/aerc.go @@ -19,8 +19,8 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/crypto" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/app/compose.go b/app/compose.go index c71c7013..451981cd 100644 --- a/app/compose.go +++ b/app/compose.go @@ -23,11 +23,11 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/format" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/send" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/templates" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/vaxis" diff --git a/app/dirlist.go b/app/dirlist.go index d4171a74..898b8130 100644 --- a/app/dirlist.go +++ b/app/dirlist.go @@ -10,10 +10,10 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/templates" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/vaxis" diff --git a/app/dirtree.go b/app/dirtree.go index 995c8889..53ab4aad 100644 --- a/app/dirtree.go +++ b/app/dirtree.go @@ -9,9 +9,9 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/vaxis" diff --git a/app/listbox.go b/app/listbox.go index 5568d36b..90227122 100644 --- a/app/listbox.go +++ b/app/listbox.go @@ -7,8 +7,8 @@ import ( "sync" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rockorager/vaxis" "github.com/mattn/go-runewidth" ) diff --git a/app/msglist.go b/app/msglist.go index e46f3f24..4cdf614a 100644 --- a/app/msglist.go +++ b/app/msglist.go @@ -11,9 +11,9 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/vaxis" diff --git a/app/msgviewer.go b/app/msgviewer.go index a22d2c15..7b24e756 100644 --- a/app/msgviewer.go +++ b/app/msgviewer.go @@ -19,9 +19,9 @@ import ( "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/auth" "git.sr.ht/~rjarry/aerc/lib/format" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/go-opt" "git.sr.ht/~rockorager/vaxis" diff --git a/app/spinner.go b/app/spinner.go index 2c675e3c..28cee9b8 100644 --- a/app/spinner.go +++ b/app/spinner.go @@ -6,8 +6,8 @@ import ( "time" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rockorager/vaxis" ) diff --git a/app/status.go b/app/status.go index 952a3b98..f1400136 100644 --- a/app/status.go +++ b/app/status.go @@ -8,10 +8,10 @@ import ( "github.com/mattn/go-runewidth" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/templates" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rockorager/vaxis" ) diff --git a/app/terminal.go b/app/terminal.go index 2527ef1a..7f9857dc 100644 --- a/app/terminal.go +++ b/app/terminal.go @@ -5,8 +5,8 @@ import ( "sync/atomic" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rockorager/vaxis" "git.sr.ht/~rockorager/vaxis/widgets/term" ) diff --git a/commands/account/export-mbox.go b/commands/account/export-mbox.go index 53f22d87..021eecc6 100644 --- a/commands/account/export-mbox.go +++ b/commands/account/export-mbox.go @@ -11,8 +11,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 2d9c81f9..1b05f16d 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -11,8 +11,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" "git.sr.ht/~rjarry/aerc/worker/types" diff --git a/commands/account/search.go b/commands/account/search.go index cd449dfa..d4e04803 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -9,10 +9,10 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/commands.go b/commands/commands.go index b617bade..ab9c3e63 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -13,9 +13,9 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/state" "git.sr.ht/~rjarry/aerc/lib/templates" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" ) diff --git a/commands/completion_helpers.go b/commands/completion_helpers.go index b7ba6780..02c13526 100644 --- a/commands/completion_helpers.go +++ b/commands/completion_helpers.go @@ -8,7 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/completer" "git.sr.ht/~rjarry/aerc/config" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) // GetAddress uses the address-book-cmd for address completion diff --git a/commands/compose/attach.go b/commands/compose/attach.go index fa9590c9..2cf43e80 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -14,9 +14,9 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "github.com/pkg/errors" ) diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go index 3c23eda3..d5b3ed2f 100644 --- a/commands/compose/postpone.go +++ b/commands/compose/postpone.go @@ -8,7 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/compose/send.go b/commands/compose/send.go index f8a0480f..2e7590a0 100644 --- a/commands/compose/send.go +++ b/commands/compose/send.go @@ -15,8 +15,8 @@ import ( "git.sr.ht/~rjarry/aerc/commands/mode" "git.sr.ht/~rjarry/aerc/commands/msg" "git.sr.ht/~rjarry/aerc/lib/hooks" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/send" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-message/mail" diff --git a/commands/exec.go b/commands/exec.go index 874b2714..ac33cf21 100644 --- a/commands/exec.go +++ b/commands/exec.go @@ -7,7 +7,7 @@ import ( "time" "git.sr.ht/~rjarry/aerc/app" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) type ExecCmd struct { diff --git a/commands/history.go b/commands/history.go index cc85f3ba..0a7d6894 100644 --- a/commands/history.go +++ b/commands/history.go @@ -8,8 +8,8 @@ import ( "os" "sync" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" ) type cmdHistory struct { diff --git a/commands/menu.go b/commands/menu.go index e14e4e83..6ebba81f 100644 --- a/commands/menu.go +++ b/commands/menu.go @@ -9,8 +9,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/go-opt" ) diff --git a/commands/msg/archive.go b/commands/msg/archive.go index 49f375a8..25f68c8a 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -8,7 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/bounce.go b/commands/msg/bounce.go index 46445bdd..d999007d 100644 --- a/commands/msg/bounce.go +++ b/commands/msg/bounce.go @@ -13,8 +13,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/commands/mode" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/send" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/copy.go b/commands/msg/copy.go index ed963707..cd13421f 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -8,7 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/envelope.go b/commands/msg/envelope.go index 24867fc1..f95af959 100644 --- a/commands/msg/envelope.go +++ b/commands/msg/envelope.go @@ -8,7 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib/format" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "github.com/emersion/go-message/mail" ) diff --git a/commands/msg/forward.go b/commands/msg/forward.go index bc3f9a68..956d5a38 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -18,7 +18,7 @@ import ( "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/crypto" "git.sr.ht/~rjarry/aerc/lib/format" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-message/mail" diff --git a/commands/msg/invite.go b/commands/msg/invite.go index 862af23c..0d45c43f 100644 --- a/commands/msg/invite.go +++ b/commands/msg/invite.go @@ -11,7 +11,7 @@ import ( "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/calendar" "git.sr.ht/~rjarry/aerc/lib/format" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "github.com/emersion/go-message/mail" ) diff --git a/commands/msg/move.go b/commands/msg/move.go index 704ca6e6..66738c68 100644 --- a/commands/msg/move.go +++ b/commands/msg/move.go @@ -9,9 +9,9 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/marker" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 8b47c418..7048e6b8 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -12,7 +12,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" mboxer "git.sr.ht/~rjarry/aerc/worker/mbox" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/recall.go b/commands/msg/recall.go index e5cd2ed1..0c7f6b53 100644 --- a/commands/msg/recall.go +++ b/commands/msg/recall.go @@ -14,7 +14,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/commands/msg/reply.go b/commands/msg/reply.go index ee31a37e..7a51a051 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -15,8 +15,8 @@ import ( "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/crypto" "git.sr.ht/~rjarry/aerc/lib/format" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/danwakefield/fnmatch" "github.com/emersion/go-message/mail" diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go index 7ba497b4..3a9e2f51 100644 --- a/commands/msg/unsubscribe.go +++ b/commands/msg/unsubscribe.go @@ -12,7 +12,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-message/mail" ) diff --git a/commands/msgview/open-link.go b/commands/msgview/open-link.go index e64e6e2f..9f02f795 100644 --- a/commands/msgview/open-link.go +++ b/commands/msgview/open-link.go @@ -7,7 +7,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) type OpenLink struct { diff --git a/commands/msgview/open.go b/commands/msgview/open.go index 3943b21a..85005031 100644 --- a/commands/msgview/open.go +++ b/commands/msgview/open.go @@ -10,7 +10,7 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) type Open struct { diff --git a/commands/msgview/save.go b/commands/msgview/save.go index d9320293..1a219e93 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -12,8 +12,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" ) diff --git a/commands/patch/apply.go b/commands/patch/apply.go index 5ffe86d1..c9818876 100644 --- a/commands/patch/apply.go +++ b/commands/patch/apply.go @@ -9,9 +9,9 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/commands/msg" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) type Apply struct { diff --git a/commands/patch/drop.go b/commands/patch/drop.go index 06457c72..a888568a 100644 --- a/commands/patch/drop.go +++ b/commands/patch/drop.go @@ -6,8 +6,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama" - "git.sr.ht/~rjarry/aerc/log" ) type Drop struct { diff --git a/commands/patch/rebase.go b/commands/patch/rebase.go index 65aa580a..45136935 100644 --- a/commands/patch/rebase.go +++ b/commands/patch/rebase.go @@ -14,10 +14,10 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama" "git.sr.ht/~rjarry/aerc/lib/pama/models" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" ) type Rebase struct { diff --git a/commands/patch/switch.go b/commands/patch/switch.go index aab2acb6..dc9138d8 100644 --- a/commands/patch/switch.go +++ b/commands/patch/switch.go @@ -6,8 +6,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama" - "git.sr.ht/~rjarry/aerc/log" ) type Switch struct { diff --git a/commands/patch/unlink.go b/commands/patch/unlink.go index 4a78281e..2d24d25b 100644 --- a/commands/patch/unlink.go +++ b/commands/patch/unlink.go @@ -6,8 +6,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama" - "git.sr.ht/~rjarry/aerc/log" ) type Unlink struct { diff --git a/commands/util.go b/commands/util.go index 0f6c7cb6..39c9dafc 100644 --- a/commands/util.go +++ b/commands/util.go @@ -14,8 +14,8 @@ import ( "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rjarry/go-opt" diff --git a/completer/completer.go b/completer/completer.go index 647e9ed7..55559d59 100644 --- a/completer/completer.go +++ b/completer/completer.go @@ -12,7 +12,7 @@ import ( "strings" "syscall" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/go-opt" ) diff --git a/config/accounts.go b/config/accounts.go index ac0a5444..b5bfbe9a 100644 --- a/config/accounts.go +++ b/config/accounts.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-message/mail" "github.com/go-ini/ini" ) diff --git a/config/binds.go b/config/binds.go index 8a8cce83..c288864a 100644 --- a/config/binds.go +++ b/config/binds.go @@ -11,7 +11,7 @@ import ( "strings" "unicode" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rockorager/vaxis" "github.com/go-ini/ini" ) diff --git a/config/compose.go b/config/compose.go index 463723cf..d6f25d31 100644 --- a/config/compose.go +++ b/config/compose.go @@ -3,7 +3,7 @@ package config import ( "regexp" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/converters.go b/config/converters.go index 72c1cbd4..829361fb 100644 --- a/config/converters.go +++ b/config/converters.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/filters.go b/config/filters.go index 113a6de6..1bbeaa30 100644 --- a/config/filters.go +++ b/config/filters.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/general.go b/config/general.go index 93794b6a..6dc674b0 100644 --- a/config/general.go +++ b/config/general.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "github.com/go-ini/ini" "github.com/mattn/go-isatty" ) diff --git a/config/hooks.go b/config/hooks.go index bc04ac75..4fc9482e 100644 --- a/config/hooks.go +++ b/config/hooks.go @@ -1,7 +1,7 @@ package config import ( - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/openers.go b/config/openers.go index 31d99e9c..95273aa4 100644 --- a/config/openers.go +++ b/config/openers.go @@ -3,7 +3,7 @@ package config import ( "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/statusline.go b/config/statusline.go index 7af0d744..f00067db 100644 --- a/config/statusline.go +++ b/config/statusline.go @@ -1,7 +1,7 @@ package config import ( - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/config/templates.go b/config/templates.go index 61c411fb..edcd3abb 100644 --- a/config/templates.go +++ b/config/templates.go @@ -4,8 +4,8 @@ import ( "path" "time" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/templates" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/emersion/go-message/mail" "github.com/go-ini/ini" diff --git a/config/ui.go b/config/ui.go index ee561a52..ba7ba967 100644 --- a/config/ui.go +++ b/config/ui.go @@ -8,7 +8,7 @@ import ( "text/template" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rockorager/vaxis" "github.com/emersion/go-message/mail" "github.com/go-ini/ini" diff --git a/config/viewer.go b/config/viewer.go index 6d8a9957..634a3a05 100644 --- a/config/viewer.go +++ b/config/viewer.go @@ -1,7 +1,7 @@ package config import ( - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/go-ini/ini" ) diff --git a/lib/attachment.go b/lib/attachment.go index a8a8103d..aa3cd108 100644 --- a/lib/attachment.go +++ b/lib/attachment.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-message/mail" "github.com/pkg/errors" ) diff --git a/lib/crypto/crypto.go b/lib/crypto/crypto.go index e58e6075..af3d1e78 100644 --- a/lib/crypto/crypto.go +++ b/lib/crypto/crypto.go @@ -7,7 +7,7 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/crypto/gpg" "git.sr.ht/~rjarry/aerc/lib/crypto/pgp" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "github.com/ProtonMail/go-crypto/openpgp" "github.com/emersion/go-message/mail" diff --git a/lib/crypto/gpg/gpgbin/gpgbin.go b/lib/crypto/gpg/gpgbin/gpgbin.go index a83ebb37..69f290fd 100644 --- a/lib/crypto/gpg/gpgbin/gpgbin.go +++ b/lib/crypto/gpg/gpgbin/gpgbin.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" ) diff --git a/lib/crypto/pgp/pgp.go b/lib/crypto/pgp/pgp.go index af406446..6195233d 100644 --- a/lib/crypto/pgp/pgp.go +++ b/lib/crypto/pgp/pgp.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/ProtonMail/go-crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp/armor" diff --git a/lib/hooks/exec.go b/lib/hooks/exec.go index bea35f32..ecc33b28 100644 --- a/lib/hooks/exec.go +++ b/lib/hooks/exec.go @@ -4,7 +4,7 @@ import ( "os" "os/exec" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) func RunHook(h HookType) error { diff --git a/lib/ipc/receive.go b/lib/ipc/receive.go index dbacc660..e2fffaf0 100644 --- a/lib/ipc/receive.go +++ b/lib/ipc/receive.go @@ -14,8 +14,8 @@ import ( "git.sr.ht/~rjarry/go-opt" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" ) type AercServer struct { diff --git a/lib/log/logger.go b/lib/log/logger.go new file mode 100644 index 00000000..2ece5f32 --- /dev/null +++ b/lib/log/logger.go @@ -0,0 +1,152 @@ +package log + +import ( + "fmt" + "io" + "log" + "os" + "strings" +) + +type LogLevel int + +const ( + TRACE LogLevel = 5 + DEBUG LogLevel = 10 + INFO LogLevel = 20 + WARN LogLevel = 30 + ERROR LogLevel = 40 +) + +var ( + trace *log.Logger + dbg *log.Logger + info *log.Logger + warn *log.Logger + err *log.Logger + minLevel LogLevel = TRACE +) + +func Init(file *os.File, level LogLevel) { + minLevel = level + flags := log.Ldate | log.Ltime | log.Lmicroseconds | log.Lshortfile + if file != nil { + trace = log.New(file, "TRACE ", flags) + dbg = log.New(file, "DEBUG ", flags) + info = log.New(file, "INFO ", flags) + warn = log.New(file, "WARN ", flags) + err = log.New(file, "ERROR ", flags) + } +} + +func ParseLevel(value string) (LogLevel, error) { + switch strings.ToLower(value) { + case "trace": + return TRACE, nil + case "debug": + return DEBUG, nil + case "info": + return INFO, nil + case "warn", "warning": + return WARN, nil + case "err", "error": + return ERROR, nil + } + return 0, fmt.Errorf("%s: invalid log level", value) +} + +func ErrorLogger() *log.Logger { + if err == nil { + return log.New(io.Discard, "", log.LstdFlags) + } + return err +} + +type Logger interface { + Tracef(string, ...interface{}) + Debugf(string, ...interface{}) + Infof(string, ...interface{}) + Warnf(string, ...interface{}) + Errorf(string, ...interface{}) +} + +type logger struct { + name string + calldepth int +} + +func NewLogger(name string, calldepth int) Logger { + return &logger{name: name, calldepth: calldepth} +} + +func (l *logger) format(message string, args ...interface{}) string { + if len(args) > 0 { + message = fmt.Sprintf(message, args...) + } + if l.name != "" { + message = fmt.Sprintf("[%s] %s", l.name, message) + } + return message +} + +func (l *logger) Tracef(message string, args ...interface{}) { + if trace == nil || minLevel > TRACE { + return + } + message = l.format(message, args...) + trace.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log +} + +func (l *logger) Debugf(message string, args ...interface{}) { + if dbg == nil || minLevel > DEBUG { + return + } + message = l.format(message, args...) + dbg.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log +} + +func (l *logger) Infof(message string, args ...interface{}) { + if info == nil || minLevel > INFO { + return + } + message = l.format(message, args...) + info.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log +} + +func (l *logger) Warnf(message string, args ...interface{}) { + if warn == nil || minLevel > WARN { + return + } + message = l.format(message, args...) + warn.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log +} + +func (l *logger) Errorf(message string, args ...interface{}) { + if err == nil || minLevel > ERROR { + return + } + message = l.format(message, args...) + err.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log +} + +var root = logger{calldepth: 3} + +func Tracef(message string, args ...interface{}) { + root.Tracef(message, args...) +} + +func Debugf(message string, args ...interface{}) { + root.Debugf(message, args...) +} + +func Infof(message string, args ...interface{}) { + root.Infof(message, args...) +} + +func Warnf(message string, args ...interface{}) { + root.Warnf(message, args...) +} + +func Errorf(message string, args ...interface{}) { + root.Errorf(message, args...) +} diff --git a/lib/log/panic-logger.go b/lib/log/panic-logger.go new file mode 100644 index 00000000..a1904415 --- /dev/null +++ b/lib/log/panic-logger.go @@ -0,0 +1,60 @@ +package log + +import ( + "fmt" + "io" + "os" + "runtime/debug" + "strings" + "time" +) + +var ( + UICleanup = func() {} + BuildInfo string +) + +// PanicHandler tries to restore the terminal. A stack trace is written to +// aerc-crash.log and then passed on if a panic occurs. +func PanicHandler() { + r := recover() + + if r == nil { + return + } + + UICleanup() + + filename := time.Now().Format("/tmp/aerc-crash-20060102-150405.log") + + panicLog, err := os.OpenFile(filename, os.O_SYNC|os.O_APPEND|os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0o600) + if err != nil { + // we tried, not possible. bye + panic(r) + } + defer panicLog.Close() + + outputs := io.MultiWriter(panicLog, os.Stderr) + + // if any error happens here, we do not care. + fmt.Fprintln(panicLog, strings.Repeat("#", 80)) + fmt.Fprint(panicLog, strings.Repeat(" ", 34)) + fmt.Fprintln(panicLog, "PANIC CAUGHT!") + fmt.Fprint(panicLog, strings.Repeat(" ", 24)) + fmt.Fprintln(panicLog, time.Now().Format("2006-01-02T15:04:05.000000-0700")) + fmt.Fprintln(panicLog, strings.Repeat("#", 80)) + fmt.Fprintf(outputs, "%s\n", panicMessage) + fmt.Fprintf(outputs, "Version: %s\n", BuildInfo) + fmt.Fprintf(panicLog, "Error: %v\n\n", r) + panicLog.Write(debug.Stack()) //nolint:errcheck // we are already in a panic, so not much we can do here + fmt.Fprintf(os.Stderr, "\nThis error was also written to: %s\n", filename) + panic(r) +} + +const panicMessage = ` +aerc has encountered a critical error and has terminated. Please help us fix +this by sending this log and the steps to reproduce the crash to: +~rjarry/aerc-devel@lists.sr.ht + +Thank you +` diff --git a/lib/messageview.go b/lib/messageview.go index 6e1ce858..34549023 100644 --- a/lib/messageview.go +++ b/lib/messageview.go @@ -10,8 +10,8 @@ import ( _ "github.com/emersion/go-message/charset" "git.sr.ht/~rjarry/aerc/lib/crypto" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/rfc822" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/lib/open.go b/lib/open.go index 21bee748..5ca819e0 100644 --- a/lib/open.go +++ b/lib/open.go @@ -10,7 +10,7 @@ import ( "github.com/danwakefield/fnmatch" "git.sr.ht/~rjarry/aerc/config" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) func XDGOpenMime( diff --git a/lib/pama/apply.go b/lib/pama/apply.go index 3d701347..f97c7701 100644 --- a/lib/pama/apply.go +++ b/lib/pama/apply.go @@ -6,8 +6,8 @@ import ( "math/rand" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) func (m PatchManager) CurrentProject() (p models.Project, err error) { diff --git a/lib/pama/drop.go b/lib/pama/drop.go index 595bc87d..fd48575b 100644 --- a/lib/pama/drop.go +++ b/lib/pama/drop.go @@ -3,8 +3,8 @@ package pama import ( "fmt" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) func (m PatchManager) DropPatch(patch string) error { diff --git a/lib/pama/list.go b/lib/pama/list.go index 950f130d..7ab9e3d1 100644 --- a/lib/pama/list.go +++ b/lib/pama/list.go @@ -5,8 +5,8 @@ import ( "io" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) func (m PatchManager) Projects(name string) ([]models.Project, error) { diff --git a/lib/pama/models/view.go b/lib/pama/models/view.go index 6a5b6bd4..ff2aa710 100644 --- a/lib/pama/models/view.go +++ b/lib/pama/models/view.go @@ -6,7 +6,7 @@ import ( "strings" "text/template" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) var templateText = ` diff --git a/lib/pama/revctrl/git.go b/lib/pama/revctrl/git.go index 2a35754e..ce024078 100644 --- a/lib/pama/revctrl/git.go +++ b/lib/pama/revctrl/git.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) func init() { diff --git a/lib/pama/revctrl/revctrl.go b/lib/pama/revctrl/revctrl.go index 42532216..cd9202f0 100644 --- a/lib/pama/revctrl/revctrl.go +++ b/lib/pama/revctrl/revctrl.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" - "git.sr.ht/~rjarry/aerc/log" ) var ErrUnsupported = errors.New("unsupported") diff --git a/lib/pama/store/store.go b/lib/pama/store/store.go index aaee5412..385d607e 100644 --- a/lib/pama/store/store.go +++ b/lib/pama/store/store.go @@ -8,9 +8,9 @@ import ( "path" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "github.com/syndtr/goleveldb/leveldb" ) diff --git a/lib/pama/unlink.go b/lib/pama/unlink.go index 2def5403..6a35e1a3 100644 --- a/lib/pama/unlink.go +++ b/lib/pama/unlink.go @@ -3,7 +3,7 @@ package pama import ( "fmt" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) // Unlink removes provided project diff --git a/lib/pama/worktree.go b/lib/pama/worktree.go index 9ecfadf6..1718e430 100644 --- a/lib/pama/worktree.go +++ b/lib/pama/worktree.go @@ -7,9 +7,9 @@ import ( "path/filepath" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/pama/models" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" ) func cacheDir() (string, error) { diff --git a/lib/parse/ansi.go b/lib/parse/ansi.go index df50042c..12ea4c07 100644 --- a/lib/parse/ansi.go +++ b/lib/parse/ansi.go @@ -8,7 +8,7 @@ import ( "os" "regexp" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) var AnsiReg = regexp.MustCompile("\x1B\\[[0-?]*[ -/]*[@-~]") diff --git a/lib/parse/daterange.go b/lib/parse/daterange.go index bd984ed5..26368609 100644 --- a/lib/parse/daterange.go +++ b/lib/parse/daterange.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) const dateFmt = "2006-01-02" diff --git a/lib/parse/header.go b/lib/parse/header.go index 361b3af0..522d178c 100644 --- a/lib/parse/header.go +++ b/lib/parse/header.go @@ -3,7 +3,7 @@ package parse import ( "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-message/mail" ) diff --git a/lib/parse/match.go b/lib/parse/match.go index ac43673e..dc5a06cc 100644 --- a/lib/parse/match.go +++ b/lib/parse/match.go @@ -4,7 +4,7 @@ import ( "regexp" "sync" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) var reCache sync.Map diff --git a/lib/rfc822/message.go b/lib/rfc822/message.go index 7b0d0552..f511ea19 100644 --- a/lib/rfc822/message.go +++ b/lib/rfc822/message.go @@ -10,8 +10,8 @@ import ( "strings" "time" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/emersion/go-message" _ "github.com/emersion/go-message/charset" diff --git a/lib/state/templates.go b/lib/state/templates.go index ec679211..e1570cd3 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -10,9 +10,9 @@ import ( "time" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/danwakefield/fnmatch" sortthread "github.com/emersion/go-imap-sortthread" diff --git a/lib/threadbuilder.go b/lib/threadbuilder.go index 63ae80d3..c18ab3d0 100644 --- a/lib/threadbuilder.go +++ b/lib/threadbuilder.go @@ -6,7 +6,7 @@ import ( "time" "git.sr.ht/~rjarry/aerc/lib/iterator" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/gatherstars-com/jwz" diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index a01184f2..29f71509 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -9,7 +9,7 @@ import ( "github.com/mattn/go-runewidth" "git.sr.ht/~rjarry/aerc/config" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rockorager/vaxis" ) diff --git a/lib/ui/ui.go b/lib/ui/ui.go index ce0a7e93..d63ebf36 100644 --- a/lib/ui/ui.go +++ b/lib/ui/ui.go @@ -7,7 +7,7 @@ import ( "syscall" "git.sr.ht/~rjarry/aerc/config" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rockorager/vaxis" ) diff --git a/lib/watchers/fsevents.go b/lib/watchers/fsevents.go index 905db2af..a273dcb0 100644 --- a/lib/watchers/fsevents.go +++ b/lib/watchers/fsevents.go @@ -6,7 +6,7 @@ package watchers import ( "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/fsnotify/fsevents" ) diff --git a/lib/watchers/inotify.go b/lib/watchers/inotify.go index 22290307..dd34fc4f 100644 --- a/lib/watchers/inotify.go +++ b/lib/watchers/inotify.go @@ -4,7 +4,7 @@ package watchers import ( - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/fsnotify/fsnotify" ) diff --git a/lib/xdg/home.go b/lib/xdg/home.go index 3471e5e2..39894cf6 100644 --- a/lib/xdg/home.go +++ b/lib/xdg/home.go @@ -6,7 +6,7 @@ import ( "path" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) // assign to a local var to allow mocking in unit tests diff --git a/log/logger.go b/log/logger.go deleted file mode 100644 index 2ece5f32..00000000 --- a/log/logger.go +++ /dev/null @@ -1,152 +0,0 @@ -package log - -import ( - "fmt" - "io" - "log" - "os" - "strings" -) - -type LogLevel int - -const ( - TRACE LogLevel = 5 - DEBUG LogLevel = 10 - INFO LogLevel = 20 - WARN LogLevel = 30 - ERROR LogLevel = 40 -) - -var ( - trace *log.Logger - dbg *log.Logger - info *log.Logger - warn *log.Logger - err *log.Logger - minLevel LogLevel = TRACE -) - -func Init(file *os.File, level LogLevel) { - minLevel = level - flags := log.Ldate | log.Ltime | log.Lmicroseconds | log.Lshortfile - if file != nil { - trace = log.New(file, "TRACE ", flags) - dbg = log.New(file, "DEBUG ", flags) - info = log.New(file, "INFO ", flags) - warn = log.New(file, "WARN ", flags) - err = log.New(file, "ERROR ", flags) - } -} - -func ParseLevel(value string) (LogLevel, error) { - switch strings.ToLower(value) { - case "trace": - return TRACE, nil - case "debug": - return DEBUG, nil - case "info": - return INFO, nil - case "warn", "warning": - return WARN, nil - case "err", "error": - return ERROR, nil - } - return 0, fmt.Errorf("%s: invalid log level", value) -} - -func ErrorLogger() *log.Logger { - if err == nil { - return log.New(io.Discard, "", log.LstdFlags) - } - return err -} - -type Logger interface { - Tracef(string, ...interface{}) - Debugf(string, ...interface{}) - Infof(string, ...interface{}) - Warnf(string, ...interface{}) - Errorf(string, ...interface{}) -} - -type logger struct { - name string - calldepth int -} - -func NewLogger(name string, calldepth int) Logger { - return &logger{name: name, calldepth: calldepth} -} - -func (l *logger) format(message string, args ...interface{}) string { - if len(args) > 0 { - message = fmt.Sprintf(message, args...) - } - if l.name != "" { - message = fmt.Sprintf("[%s] %s", l.name, message) - } - return message -} - -func (l *logger) Tracef(message string, args ...interface{}) { - if trace == nil || minLevel > TRACE { - return - } - message = l.format(message, args...) - trace.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log -} - -func (l *logger) Debugf(message string, args ...interface{}) { - if dbg == nil || minLevel > DEBUG { - return - } - message = l.format(message, args...) - dbg.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log -} - -func (l *logger) Infof(message string, args ...interface{}) { - if info == nil || minLevel > INFO { - return - } - message = l.format(message, args...) - info.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log -} - -func (l *logger) Warnf(message string, args ...interface{}) { - if warn == nil || minLevel > WARN { - return - } - message = l.format(message, args...) - warn.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log -} - -func (l *logger) Errorf(message string, args ...interface{}) { - if err == nil || minLevel > ERROR { - return - } - message = l.format(message, args...) - err.Output(l.calldepth, message) //nolint:errcheck // we can't do anything with what we log -} - -var root = logger{calldepth: 3} - -func Tracef(message string, args ...interface{}) { - root.Tracef(message, args...) -} - -func Debugf(message string, args ...interface{}) { - root.Debugf(message, args...) -} - -func Infof(message string, args ...interface{}) { - root.Infof(message, args...) -} - -func Warnf(message string, args ...interface{}) { - root.Warnf(message, args...) -} - -func Errorf(message string, args ...interface{}) { - root.Errorf(message, args...) -} diff --git a/log/panic-logger.go b/log/panic-logger.go deleted file mode 100644 index a1904415..00000000 --- a/log/panic-logger.go +++ /dev/null @@ -1,60 +0,0 @@ -package log - -import ( - "fmt" - "io" - "os" - "runtime/debug" - "strings" - "time" -) - -var ( - UICleanup = func() {} - BuildInfo string -) - -// PanicHandler tries to restore the terminal. A stack trace is written to -// aerc-crash.log and then passed on if a panic occurs. -func PanicHandler() { - r := recover() - - if r == nil { - return - } - - UICleanup() - - filename := time.Now().Format("/tmp/aerc-crash-20060102-150405.log") - - panicLog, err := os.OpenFile(filename, os.O_SYNC|os.O_APPEND|os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0o600) - if err != nil { - // we tried, not possible. bye - panic(r) - } - defer panicLog.Close() - - outputs := io.MultiWriter(panicLog, os.Stderr) - - // if any error happens here, we do not care. - fmt.Fprintln(panicLog, strings.Repeat("#", 80)) - fmt.Fprint(panicLog, strings.Repeat(" ", 34)) - fmt.Fprintln(panicLog, "PANIC CAUGHT!") - fmt.Fprint(panicLog, strings.Repeat(" ", 24)) - fmt.Fprintln(panicLog, time.Now().Format("2006-01-02T15:04:05.000000-0700")) - fmt.Fprintln(panicLog, strings.Repeat("#", 80)) - fmt.Fprintf(outputs, "%s\n", panicMessage) - fmt.Fprintf(outputs, "Version: %s\n", BuildInfo) - fmt.Fprintf(panicLog, "Error: %v\n\n", r) - panicLog.Write(debug.Stack()) //nolint:errcheck // we are already in a panic, so not much we can do here - fmt.Fprintf(os.Stderr, "\nThis error was also written to: %s\n", filename) - panic(r) -} - -const panicMessage = ` -aerc has encountered a critical error and has terminated. Please help us fix -this by sending this log and the steps to reproduce the crash to: -~rjarry/aerc-devel@lists.sr.ht - -Thank you -` diff --git a/main.go b/main.go index a9a433f1..60cfbbd8 100644 --- a/main.go +++ b/main.go @@ -21,9 +21,9 @@ import ( "git.sr.ht/~rjarry/aerc/lib/crypto" "git.sr.ht/~rjarry/aerc/lib/hooks" "git.sr.ht/~rjarry/aerc/lib/ipc" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/templates" "git.sr.ht/~rjarry/aerc/lib/ui" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" diff --git a/worker/imap/cache.go b/worker/imap/cache.go index e33736cc..8ae60f03 100644 --- a/worker/imap/cache.go +++ b/worker/imap/cache.go @@ -9,9 +9,9 @@ import ( "strings" "time" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-message" diff --git a/worker/imap/connect.go b/worker/imap/connect.go index 79254bb9..6c704d35 100644 --- a/worker/imap/connect.go +++ b/worker/imap/connect.go @@ -7,7 +7,7 @@ import ( "time" "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-imap" "github.com/emersion/go-imap/client" ) diff --git a/worker/imap/extensions/xgmext/client.go b/worker/imap/extensions/xgmext/client.go index 62d081b2..3d9ce1e9 100644 --- a/worker/imap/extensions/xgmext/client.go +++ b/worker/imap/extensions/xgmext/client.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "github.com/emersion/go-imap" "github.com/emersion/go-imap/client" "github.com/emersion/go-imap/commands" diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index 12e2fbdd..46ca8a5f 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -10,8 +10,8 @@ import ( "github.com/emersion/go-message/mail" "github.com/emersion/go-message/textproto" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/parse" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/imap/flags.go b/worker/imap/flags.go index 945597df..06680818 100644 --- a/worker/imap/flags.go +++ b/worker/imap/flags.go @@ -3,7 +3,7 @@ package imap import ( "github.com/emersion/go-imap" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/imap/idler.go b/worker/imap/idler.go index 369ebd2e..b43c0269 100644 --- a/worker/imap/idler.go +++ b/worker/imap/idler.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-imap" ) diff --git a/worker/imap/list.go b/worker/imap/list.go index 5a97d5e2..d12ae4bd 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -5,7 +5,7 @@ import ( "github.com/emersion/go-imap" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/imap/observer.go b/worker/imap/observer.go index 7a604a1a..d3106cd1 100644 --- a/worker/imap/observer.go +++ b/worker/imap/observer.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-imap" ) diff --git a/worker/jmap/cache/cache.go b/worker/jmap/cache/cache.go index 6d815177..429dafe9 100644 --- a/worker/jmap/cache/cache.go +++ b/worker/jmap/cache/cache.go @@ -6,8 +6,8 @@ import ( "path" "strings" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/util" ) diff --git a/worker/jmap/cache/folder_contents.go b/worker/jmap/cache/folder_contents.go index 46a36607..e0edf77d 100644 --- a/worker/jmap/cache/folder_contents.go +++ b/worker/jmap/cache/folder_contents.go @@ -3,7 +3,7 @@ package cache import ( "reflect" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/go-jmap" ) diff --git a/worker/jmap/push.go b/worker/jmap/push.go index 2f7b05e6..cb3394d1 100644 --- a/worker/jmap/push.go +++ b/worker/jmap/push.go @@ -5,7 +5,7 @@ import ( "sort" "time" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/jmap/cache" "git.sr.ht/~rjarry/aerc/worker/types" diff --git a/worker/jmap/send.go b/worker/jmap/send.go index 0d8bb23f..7f5ffc4f 100644 --- a/worker/jmap/send.go +++ b/worker/jmap/send.go @@ -5,7 +5,7 @@ import ( "io" "strings" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rockorager/go-jmap" "git.sr.ht/~rockorager/go-jmap/mail/email" diff --git a/worker/lib/search.go b/worker/lib/search.go index 16e44d96..31e4843f 100644 --- a/worker/lib/search.go +++ b/worker/lib/search.go @@ -6,8 +6,8 @@ import ( "unicode" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/rfc822" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "git.sr.ht/~rjarry/go-opt" diff --git a/worker/maildir/container.go b/worker/maildir/container.go index 23c96617..dea1ded6 100644 --- a/worker/maildir/container.go +++ b/worker/maildir/container.go @@ -8,8 +8,8 @@ import ( "github.com/emersion/go-maildir" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/uidstore" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/worker/lib" ) diff --git a/worker/maildir/message.go b/worker/maildir/message.go index 1f89cfe3..6bc54cac 100644 --- a/worker/maildir/message.go +++ b/worker/maildir/message.go @@ -6,8 +6,8 @@ import ( "github.com/emersion/go-maildir" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/rfc822" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/lib" ) diff --git a/worker/maildir/search.go b/worker/maildir/search.go index 8a19d66d..90c84087 100644 --- a/worker/maildir/search.go +++ b/worker/maildir/search.go @@ -5,7 +5,7 @@ import ( "runtime" "sync" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/lib" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index 643ab8a9..f5d3a8e1 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -21,9 +21,9 @@ import ( aercLib "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/iterator" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/watchers" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" "git.sr.ht/~rjarry/aerc/worker/lib" diff --git a/worker/mbox/worker.go b/worker/mbox/worker.go index 5de3e30d..1f4a4965 100644 --- a/worker/mbox/worker.go +++ b/worker/mbox/worker.go @@ -10,8 +10,8 @@ import ( "path/filepath" "sort" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/rfc822" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" "git.sr.ht/~rjarry/aerc/worker/lib" diff --git a/worker/notmuch/eventhandlers.go b/worker/notmuch/eventhandlers.go index a8a396c9..be01a71b 100644 --- a/worker/notmuch/eventhandlers.go +++ b/worker/notmuch/eventhandlers.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strconv" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go index be30cbc0..4d853642 100644 --- a/worker/notmuch/lib/database.go +++ b/worker/notmuch/lib/database.go @@ -8,9 +8,9 @@ import ( "errors" "fmt" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/notmuch" "git.sr.ht/~rjarry/aerc/lib/uidstore" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/worker/types" ) diff --git a/worker/notmuch/message.go b/worker/notmuch/message.go index 849363f1..2a8b1730 100644 --- a/worker/notmuch/message.go +++ b/worker/notmuch/message.go @@ -12,8 +12,8 @@ import ( "github.com/emersion/go-maildir" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/rfc822" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/lib" notmuch "git.sr.ht/~rjarry/aerc/worker/notmuch/lib" diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index ddbdfc02..c5792709 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -19,9 +19,9 @@ import ( "time" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/lib/watchers" "git.sr.ht/~rjarry/aerc/lib/xdg" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" "git.sr.ht/~rjarry/aerc/worker/lib" diff --git a/worker/types/thread.go b/worker/types/thread.go index fdd2a8e6..8705ace1 100644 --- a/worker/types/thread.go +++ b/worker/types/thread.go @@ -5,7 +5,7 @@ import ( "fmt" "sort" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" ) type Thread struct { diff --git a/worker/types/worker.go b/worker/types/worker.go index 37e0e2ad..92c15bcc 100644 --- a/worker/types/worker.go +++ b/worker/types/worker.go @@ -5,7 +5,7 @@ import ( "sync" "sync/atomic" - "git.sr.ht/~rjarry/aerc/log" + "git.sr.ht/~rjarry/aerc/lib/log" "git.sr.ht/~rjarry/aerc/models" ) -- cgit