unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: First draft of logging functionality.
Date: Tue, 12 Oct 2010 13:38:42 +0200	[thread overview]
Message-ID: <87ocaz3akd.fsf@steelpick.2x.cz> (raw)
In-Reply-To: <87hbgrhd1a.fsf@rocinante.cs.unb.ca>

On Tue, 12 Oct 2010, David Bremner wrote:
> On Tue, 12 Oct 2010 11:06:17 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
> 
> > I'm not sure whether implementing logging facility outside of notmuch
> > library is a good thing. If somebody will use a third-party tool (such
> > as python bindings) to manipulate his tags, they won't appear in the
> > log.
> 
> Yeah, thanks for that. I had been worrying about the same thing, but
> your message helped clarify things for me.
> 
> I guess log files should be opened in notmuch_database_open, and the
> actual logging in this case could happen from notmuch_message_add_tag.
> 
> From an atomicity point of view it might make more sense to store up a
> list of log lines, and dump them all from _notmuch_message_sync.
> One could attach a log buffer to a message, and flush that atomically
> when syncing the message back to the database.

Yes, the above sounds good to me.

> In this context, it is a little more tedious to have more than one log
> file.

Why multiple log files? You may have the buffers for message logs in
memory, right?

Another thing to keep in mind is how it will behave with 'notmuch
restore'. If do dump followed by resore you will have a very long log
with no useful information in it. Some optimization may be employed here.

Bye
-Michal

  reply	other threads:[~2010-10-12 11:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 13:26 First draft of logging functionality david
2010-10-11 13:26 ` [PATCH 1/3] Initial implementation of low level logging routines david
2010-10-11 13:26 ` [PATCH 2/3] notmuch-log.c: Add a function to log a pair of strings with a timestamp david
2010-10-11 13:26 ` [PATCH 3/3] notmuch-tag.c: Add tag logging david
2010-10-12  9:06 ` First draft of logging functionality Michal Sojka
2010-10-12 11:21   ` David Bremner
2010-10-12 11:38     ` Michal Sojka [this message]
2010-10-12 13:16       ` David Bremner
2010-10-12 14:32 ` Rob Browning
2010-10-24 21:01 ` Second draft of logging patches david
2010-11-10  3:18   ` David Bremner
2010-11-13  5:25     ` Michal Sojka
2010-11-13 12:11       ` David Bremner
2010-10-24 21:01 ` [PATCH 1/4] Initial implementation of low level logging routines david
2010-10-24 21:01 ` [PATCH 2/4] Add log component to database struct david
2010-10-24 21:01 ` [PATCH 3/4] Add logging to low level message handling routines david
2010-10-24 21:01 ` [PATCH 4/4] Enable logging in notmuch-tag.c david

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ocaz3akd.fsf@steelpick.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).