From: Timo Sirainen Date: Tue, 1 Oct 2019 16:09:37 +0000 (+0300) Subject: lib-index: Log debug messages with e_debug() X-Git-Tag: 2.3.11.2~600 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a3dc90a012da1acc2c9abe5a1ef235999b3d1c2;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Log debug messages with e_debug() --- diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index 3a648db1e7..1f06ef3191 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -352,12 +352,10 @@ mail_cache_compress_write(struct mail_cache *cache, return -1; } - if ((cache->index->flags & MAIL_INDEX_OPEN_FLAG_DEBUG) != 0) { - i_debug("%s: Compressed, file_seq changed %u -> %u, " - "size=%"PRIuUOFF_T", max_uid=%u", cache->filepath, - cache->need_compress_file_seq, file_seq, - file_size, max_uid); - } + e_debug(cache->index->event, "%s: Compressed, file_seq changed %u -> %u, " + "size=%"PRIuUOFF_T", max_uid=%u", cache->filepath, + cache->need_compress_file_seq, file_seq, + file_size, max_uid); /* once we're sure that the compression was successful, update the offsets */ diff --git a/src/lib-index/mail-index.c b/src/lib-index/mail-index.c index 0d208af8ff..a8772c042a 100644 --- a/src/lib-index/mail-index.c +++ b/src/lib-index/mail-index.c @@ -691,6 +691,10 @@ int mail_index_open(struct mail_index *index, enum mail_index_open_flags flags) index->log_sync_locked = FALSE; index->flags = flags; index->readonly = (flags & MAIL_INDEX_OPEN_FLAG_READONLY) != 0; + if ((flags & MAIL_INDEX_OPEN_FLAG_DEBUG) != 0) + event_set_forced_debug(index->event, TRUE); + else + event_unset_forced_debug(index->event); if ((flags & MAIL_INDEX_OPEN_FLAG_NFS_FLUSH) != 0 && index->fsync_mode != FSYNC_MODE_ALWAYS)