Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

show output from hooks, be more --verbose #11

Open
anarcat opened this issue Feb 18, 2019 · 1 comment
Open

show output from hooks, be more --verbose #11

anarcat opened this issue Feb 18, 2019 · 1 comment

Comments

@anarcat
Copy link
Contributor

anarcat commented Feb 18, 2019

I have recently seen a total failure happen in my email setup. I do not know exactly what the cause was, and it was hard to diagnose because my systemd setup (#10) didn't log anything to disk.

But even if it would log, I would like to have it a little more verbose. Right now I see this in my logs:

fév 18 13:42:48 curie smd-pull[5482]: default: smd-client@localhost: TAGS: stats::new-mails(1), del-mails(0), bytes-received(31480), xdelta-received(385) 

Even in --verbose --show-tags mode, I don't see the actual emails modified, which is strange because we do see those when running in --dry-mode (see #6 for that). The --verbose flag only adds the following lines:

fév 18 13:46:52 curie smd-push[8294]: Phase 0: handshake 
fév 18 13:46:52 curie smd-push[8294]: Phase 1: changes detection 
fév 18 13:46:52 curie smd-push[8294]: Phase 2: synchronization 
fév 18 13:46:52 curie smd-push[8294]: Phase 3: agreement 

which are fairly useless in a non-interactive context.

Would it be possible to show which mails were downloaded/uploaded/deleted in --verbose mode instead of --dry-run?

Also: I run notmuch new as a post-hook. Because I first notice the catastrophe through notmuch (which was slowly removing all the emails from its database), it would be tremendously helpful it the output from hooks was also shown instead of silencing them. For example here notmuch shows:

Processed 4 total files in almost no time.
Added 3 new messages to the database.

Would you welcome patches that would change at least that behavior?

Thanks!

@anarcat
Copy link
Contributor Author

anarcat commented Feb 18, 2019

forget about the hook stuff, I found a workaround. I added the following systemd service for notmuch-new:

[Unit]
Description=notmuch new
After=smd-pull.service smd-push.service

[Service]
Type=oneshot
Nice=10
ExecStart=notmuch new

[Install]
WantedBy=multi-user.target smd-pull.service smd-push.service

... and enabled it:

systemctl --user daemon-reload
systemctl --user enable notmuch-new.service

Now it gets ran after smd-pull or push and I see it in my logs.

It would still be nice to have more extensive info about file changes however.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant