From: Rusty Russell Date: Wed, 1 Dec 2010 12:41:51 +0000 (+1030) Subject: tdb2: clean up logging X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=4e185ad8ab5a7e01edbbe12d11eb2f1577de7e8b;hp=4e185ad8ab5a7e01edbbe12d11eb2f1577de7e8b;p=ccan-lca-2011.git tdb2: clean up logging Logged errors should always set tdb->ecode before they are called, and there's little reason to have a sprintf-style logging function since we can do the formatting internally. Change the tdb_log attribute to just take a "const char *", and create a new tdb_logerr() helper which sets ecode and calls it. As a bonus, mark it COLD so the compiler can optimize appropriately knowing that it's unlikely to be invoked. ---