Menu

Logging and Output "verbosity"

Help
Quaraxkad
2015-06-19
2015-06-23
  • Quaraxkad

    Quaraxkad - 2015-06-19

    I recently had some issues with errors being counted at the end summary but the console output and log files not showing what the errors were. It isn't exactly clear how all of the verbosity and logging options work, I ended up with these questions.

    The changelog says that the -v parameter can be specified multiple times. How many times results in the most verbose output? Is it the same for every operation?

    Does -v have the same effect on a -l log, or does the log always contain a pre-determined level of verbose output?

    When a logfile is specified with -l, the console output is automatically limited to showing only progress indicators and fatal errors. If the log is always a set level, then -v has no effect when -l is specified? And then if -v has no effect on the logfile, can the parameter instead be used to increase the level of console output (as it does without -l)?

     
  • xad

    xad - 2015-06-19

    Reading the v8.1 code:

    "-v" option is not like linux verbosity levels but is setting it to '+1' which is the highest level of verbosity. Additional is increasing the msglevel but there are no higher levels, ie more to log. "-q" will reduce the msglevel and skip bar, progress, info, status in that order.

    The '-v' and '-q' is only effecting the standard output and not the logfile output.

    The logfile output is hardcoded except for "error" which is either logged to file or if logfile not specified is printed to error output, not both.

    /X

    The logging "description" is in "support.h" file.

    #define MSG_STATUS -3
    #define MSG_INFO -2
    #define MSG_PROGRESS -1
    #define MSG_BAR 0
    #define MSG_VERBOSE 1
    
    
     * Fatal error messages.
     * Messages printed before an early termination.
     * These messages go in the log file and in stderr inconditionally.
    
    
     * Unexpected error messages.
     * Messages reporting error conditions that don't prevent the program to run.
     * Some of them could be also serious errors, like "silent errors".
     * In such case, the summary result is always printed as error,
     * and we are sure to notify the user in some way.
     * These messages go in the log file if specified, otherwise they go in stderr.
    
    
     * Expected error messages, without fallback to stderr.
     * These errors are "someway" expected, and then they never go to screen.
     * For example, when undeleting missing files, the messages for missing files
     * are not shown.
     * These messages go in the log file if specified, otherwise they are lost.
    
    
     * Tag messages.
     * Messages are in tag format, like "tag:entry:...".
     * These messages never go on the screen, but only in the log file if specified.
    
    
     * State messages.
     * Messages that tell what the program is doing or did, but limited to few lines.
     * They are status information, and summary results.
    
    
     * Info messages.
     * Messages that tell what was done.
     * Potentially a lot of messages are possible. They can still be on the screen,
     * as losing them we don't lose information.
     * These messages never go in the log file, becauae there is always a corresponding log_tag().
    
    
     * Progress messages.
     * Message that tell the progress of program.
     * These messages also go in the log file.
    
    
     * Progress bar messages.
     * Message that show the percentage of the progress.
     * These messages never go in the log file.
     * These messages are buffered. Use msg_flush() to flush them.
    
    
     * Verbose messages.
     * Message that tell what is already expected.
     * These messages also go in the log file.
    
     

    Last edit: xad 2015-06-19
  • Andrea Mazzoleni

    Hi Quaraxkad,

    The Changelog is wrong about -v. There is only one verbosity level, and specifying it more than one time has no effect.

    Also, -q and -v have no effect on the log. They affect only the console output.

    When you specify -l, unexpected errors are redirected to the log files instead of going to the console output.
    Instead fatal errors are instead always printed on both.

    Ciao,
    Andrea

     
  • flvinny521

    flvinny521 - 2015-06-23

    If I could piggyback onto this discussion, I recently began using SnapRAID and ran a check command with -l specified. When I viewed the logfile, the summary at the end shows that two errors occurred, but the error details do not appear anywhere in the body of the log.

    This seems to contradict what is being said here, so maybe somebody can provide more insight as to why this might happen and how I can locate the source of the errors.

     
    • Andrea Mazzoleni

      Hi flvinny521,

      If it happens again, please report more details, including log.

      I checked all the error conditions, and it seems to me that something is always printed. Maybe it's something not easily recognizable as error.

      Ciao,
      Andrea

       
      • flvinny521

        flvinny521 - 2015-06-23

        I do have the log, although I was hesitant in posting it without heavily editing filenames, etc, before posting on a public forum. I could send it directly to you if it would be of any help.

         
  • MQMan

    MQMan - 2015-06-23

    Here's my thread on a similar issue: https://sourceforge.net/p/snapraid/discussion/1677233/thread/4d77a399

    In the end I just ran the "-e fix" and haven't seen any issues or errors since.

    Cheers.

     

    Last edit: MQMan 2015-06-23

Log in to post a comment.

MongoDB Logo MongoDB