aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2023-01-13 15:23:06 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-26 00:20:34 +0100
commit5dd7ea5d5979808484e0f5ab8f1d7aaf9f65f2f2 (patch)
treeed1d1866f8e709b3d8d95ad8c0b8a7d2ed609929
parent5b91c4a6bd542ca6e006ea36981b7f4120cc041e (diff)
downloadaerc-5dd7ea5d5979808484e0f5ab8f1d7aaf9f65f2f2.tar.gz
aerc-5dd7ea5d5979808484e0f5ab8f1d7aaf9f65f2f2.zip
logging: add trace to every command call
A previous commit introduced a trace loglevel, but aerc doesn't make much use of it. Logging is not very informative either. Add a log.Tracef to every command and log the provided arguments as well. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--commands/commands.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 1aa8e1af..6fe30592 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -8,6 +8,7 @@ import (
"github.com/google/shlex"
+ "git.sr.ht/~rjarry/aerc/log"
"git.sr.ht/~rjarry/aerc/widgets"
)
@@ -69,6 +70,7 @@ func (cmds *Commands) ExecuteCommand(aerc *widgets.Aerc, args []string) error {
return errors.New("Expected a command.")
}
if cmd, ok := cmds.dict()[args[0]]; ok {
+ log.Tracef("executing command %v", args)
return cmd.Execute(aerc, args)
}
return NoSuchCommand(args[0])