Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C027540D145 for ; Tue, 12 Oct 2010 04:38:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6riigLyZq8gD for ; Tue, 12 Oct 2010 04:38:45 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 0F7A940D143 for ; Tue, 12 Oct 2010 04:38:45 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 4BC3E19F3391; Tue, 12 Oct 2010 13:38:44 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id kOx5Cf9JQ5CP; Tue, 12 Oct 2010 13:38:43 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 1285A19F3364; Tue, 12 Oct 2010 13:38:43 +0200 (CEST) Received: from steelpick.2x.cz (note-sojka.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id EAE9EFA003; Tue, 12 Oct 2010 13:38:42 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1P5dBq-0004bP-PF; Tue, 12 Oct 2010 13:38:42 +0200 From: Michal Sojka To: David Bremner , notmuch@notmuchmail.org Subject: Re: First draft of logging functionality. In-Reply-To: <87hbgrhd1a.fsf@rocinante.cs.unb.ca> References: <1286803617-17328-1-git-send-email-david@tethera.net> <87zkuj3hme.fsf@steelpick.2x.cz> <87hbgrhd1a.fsf@rocinante.cs.unb.ca> User-Agent: Notmuch/0.3.1-83-g6fec75f (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Tue, 12 Oct 2010 13:38:42 +0200 Message-ID: <87ocaz3akd.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 11:38:55 -0000 On Tue, 12 Oct 2010, David Bremner wrote: > On Tue, 12 Oct 2010 11:06:17 +0200, Michal Sojka 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