The purpose of this pachset is to rewrite the way Mutt handles logging
when compiled with the debug mode.

First, it fixes weird usage of the "debuglevel" variable.
Then logging functions, prefixed by mutt_log_ are introduced, to init
the logging framework, get and set the log level, and writes to log.
dprint is then replaced by the new logging functions.
The last patch removes most of the "#ifdef DEBUG". Ideally, the
--enable-debug option could be removed at some point, making logs
available all the time.

I send this patch as Request For Comments, to get your feedback on two
main points, and if such changes would be welcome:
 - creating more clear subsystems/group of functions to handle some
   specific parts, in this case the logging/debugging.
 - removing some #ifdef to make the code easier to read and modify

Note that this patchset is not based on hg/tip so it might not apply
cleanly.

Damien Riegel (8):
  fix weird usage of debuglevel
  add mutt_log_init function
  add a function to set log level
  add a function to get log level
  replace dprint by mutt_log
  add a way to append to logs
  imap: make use of mutt_log_append
  undebugify mutt_log* functions

 alias.c           |  22 +++++-----
 attach.c          |  26 ++++++------
 bcache.c          |  22 +++++-----
 buffy.c           |   2 +-
 color.c           |  12 +++---
 complete.c        |   4 +-
 copy.c            |  13 +++---
 crypt-gpgme.c     |  44 ++++++++++----------
 curs_lib.c        |  12 +++---
 curs_main.c       |   2 +-
 from.c            |  12 +++---
 getdomain.c       |   2 +-
 gnupgparse.c      |  20 +++++-----
 group.c           |   2 +-
 handler.c         |  16 ++++----
 hcache.c          |  21 ++++++----
 headers.c         |   2 +-
 imap/auth.c       |   4 +-
 imap/auth_anon.c  |   4 +-
 imap/auth_cram.c  |  10 ++---
 imap/auth_gss.c   |  53 +++++++++++--------------
 imap/auth_login.c |  10 +----
 imap/auth_sasl.c  |  17 ++++----
 imap/browse.c     |  30 +++++++-------
 imap/command.c    |  92 +++++++++++++++++++++---------------------
 imap/imap.c       |  84 +++++++++++++++++++--------------------
 imap/message.c    |  65 +++++++++++++++---------------
 imap/util.c       |  10 ++---
 init.c            |  74 +++++++++++-----------------------
 lib.c             | 117 ++++++++++++++++++++++++++++++++++++++++++------------
 lib.h             |  42 +++++++++++++-------
 main.c            |  26 +++++++-----
 mbox.c            |  38 +++++++++---------
 mh.c              |  49 +++++++++++------------
 mutt_idna.c       |  26 ++++++------
 mutt_sasl.c       |  61 ++++++++++++++--------------
 mutt_socket.c     |  34 ++++++++--------
 mutt_ssl.c        |  58 +++++++++++++--------------
 mutt_ssl_gnutls.c |  14 +++----
 muttlib.c         |  36 ++++++++---------
 mx.c              |  26 ++++++------
 pager.c           |  10 ++---
 parse.c           |  44 ++++++++++----------
 pgp.c             |  28 ++++++-------
 pgpinvoke.c       |   2 +-
 pgpkey.c          |  24 +++++------
 pgpmicalg.c       |  18 ++++-----
 pop.c             |  12 +++---
 pop_auth.c        |  23 +++++------
 pop_lib.c         |  14 +++----
 postpone.c        |   4 +-
 query.c           |   4 +-
 recvattach.c      |   2 +-
 rfc1524.c         |   6 +--
 rfc3676.c         |  45 +++++++++++----------
 send.c            |   2 +-
 sendlib.c         |  50 +++++++++++------------
 smime.c           |   2 +-
 smtp.c            |  12 +++---
 snprintf.c        |   6 +--
 60 files changed, 776 insertions(+), 746 deletions(-)

-- 
2.9.0

Reply via email to