Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E5E753C.6090003@bredband.net>
Date: Wed, 31 Aug 2011 19:54:04 +0200
From: magnum <rawsmooth@...dband.net>
To: john-dev@...ts.openwall.com
Subject: log_event taking care of business (was: Outputting proper john.conf
 file name upon error)

On 2011-08-31 18:38, jfoug wrote:
> I knew this was an issue, and magnum poked me about it.
>
> If there are errors in another .conf file, that was .included, then the line
> numbers in the error message, would be right, but the file name output was
> the 'master' john.conf file originally loaded.

Great!

Speaking of logging and verbosity: LOTS of places all over john look 
just like this:

if (conditions) {
   log_event("! Warning message %d: %.100s", this, that);
#ifdef HAVE_MPI
   if (mpi_id == 0)
#endif
     fprintf(stderr, "Warning message %d: %.100s\n", this, that);
}

What if all those places were made more like this:

if (conditions)
   log_event(LOGLEVEL_WARNING, LOG_MPI_ROOT,
             "! Warning message %d: %.100s", this, that);

We should also have a new command line argument --verbosity=N that sets 
options.verbosity (or just --verbosity, no argument, bumps it by one).

In logger.c, the log_event function should take care of the rest:
  * If options.verbosity >= loglevel, print as well as log.
  * Under MPI and if log_mpi_root is non-NULL, only print if mpi_id == 0

However this is *not* for Jumbo-6 :-)

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.