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 93C6F40D148 for ; Sun, 24 Oct 2010 14:01:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] 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 gY7BJGA67+0X for ; Sun, 24 Oct 2010 14:01:37 -0700 (PDT) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) by olra.theworths.org (Postfix) with ESMTP id AD9A440D155 for ; Sun, 24 Oct 2010 14:01:14 -0700 (PDT) Received: from rocinante.cs.unb.ca (fctnnbsc30w-142167176217.pppoe-dynamic.High-Speed.nb.bellaliant.net [142.167.176.217]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id o9OL1BmO017808 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sun, 24 Oct 2010 18:01:14 -0300 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.72) (envelope-from ) id 1PA7gl-0006Oi-Ao for notmuch@notmuchmail.org; Sun, 24 Oct 2010 18:01:11 -0300 From: david@tethera.net To: notmuch@notmuchmail.org Subject: Second draft of logging patches Date: Sun, 24 Oct 2010 18:01:02 -0300 Message-Id: <1287954066-24512-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1286803617-17328-1-git-send-email-david@tethera.net> References: <1286803617-17328-1-git-send-email-david@tethera.net> 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: Sun, 24 Oct 2010 21:01:52 -0000 Here is my second try at logging, taking into account the feedback I got from Rob and Michal. There is definitely some tidying to do; in particular I know the protoypes in public headers need documentation. Also, I should add a configuration option to enable configuration by command or something like that. It does do write-ahead logging for tag changes, based on calls to notmuch_message_(freeze|thaw). It is more or less hardcoded to output to .notmuch/log At the moment the buffering is line by line, but in principle this just needs to be changed in one place (the call to notmuch_log_open). Currently logging is disabled by default, unless a call to notmuch_database_open_log is made. In the long run, if we keep this code, then maybe the API of notmuch_database_open should be modified to optionally enable logging.