Ignore:
Timestamp:
02/08/09 14:53:48 (15 years ago)
Author:
tim
Message:

extended error message logging to allow for message type filtering

fine tuned message verbosity to more reasonable default levels for reglookup and reglookup-recover

updated related documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup-recover.c

    r136 r138  
    22 * This program attempts to recover deleted data structures in a registry hive.
    33 *
    4  * Copyright (C) 2008 Timothy D. Morgan
     4 * Copyright (C) 2008-2009 Timothy D. Morgan
    55 *
    66 * This program is free software; you can redistribute it and/or modify
     
    8787    quoted_name[0] = '\0';
    8888
    89     fprintf(stderr, "WARNING: NULL key name in NK record at offset %.8X.\n",
     89    fprintf(stderr, "WARN: NULL key name in NK record at offset %.8X.\n",
    9090            nk->offset);
    9191  }
     
    125125  if(size > REGFI_VK_MAX_DATA_LENGTH)
    126126  {
    127     fprintf(stderr, "WARNING: value data size %d larger than "
     127    fprintf(stderr, "WARN: value data size %d larger than "
    128128            "%d, truncating...\n", size, REGFI_VK_MAX_DATA_LENGTH);
    129129    size = REGFI_VK_MAX_DATA_LENGTH;
     
    153153
    154154    if(conv_error == NULL)
    155       fprintf(stderr, "WARNING: Could not quote value for '%s/%s'.  "
     155      fprintf(stderr, "WARN: Could not quote value for '%s/%s'.  "
    156156              "Memory allocation failure likely.\n", prefix, quoted_name);
    157157    else if(print_verbose)
    158       fprintf(stderr, "WARNING: Could not quote value for '%s/%s'.  "
     158      fprintf(stderr, "WARN: Could not quote value for '%s/%s'.  "
    159159              "Returned error: %s\n", prefix, quoted_name, conv_error);
    160160  }
    161161  /* XXX: should these always be printed? */
    162162  else if(conv_error != NULL && print_verbose)
    163     fprintf(stderr, "VERBOSE: While quoting value for '%s/%s', "
     163    fprintf(stderr, "INFO: While quoting value for '%s/%s', "
    164164            "warning returned: %s\n", prefix, quoted_name, conv_error);
    165165
     
    279279      cur_ancestor = regfi_parse_nk(f, virt_offset+REGFI_REGF_SIZE,
    280280                                    max_length, true);
     281      printMsgs(f);
     282
    281283      if(cur_ancestor == NULL)
    282284        virt_offset = REGFI_OFFSET_NONE;
     
    426428  for(i=0; i < range_list_size(unalloc_cells); i++)
    427429  {
     430    printMsgs(f);
    428431    cur_elem = range_list_get(unalloc_cells, i);
    429432    for(j=0; cur_elem->length > REGFI_NK_MIN_LENGTH
     
    432435      key = regfi_parse_nk(f, cur_elem->offset+j,
    433436                           cur_elem->length-j, false);
     437      printMsgs(f);
     438
    434439      if(key != NULL)
    435440      {
     
    587592  for(i=0; i < range_list_size(unalloc_cells); i++)
    588593  {
     594    printMsgs(f);
    589595    cur_elem = range_list_get(unalloc_cells, i);
    590596    for(j=0; j <= cur_elem->length; j+=8)
     
    592598      vk = regfi_parse_vk(f, cur_elem->offset+j,
    593599                           cur_elem->length-j, false);
     600      printMsgs(f);
     601
    594602      if(vk != NULL)
    595603      {
     
    654662  for(i=0; i < range_list_size(unalloc_cells); i++)
    655663  {
     664    printMsgs(f);
    656665    cur_elem = range_list_get(unalloc_cells, i);
    657666    for(j=0; j <= cur_elem->length; j+=8)
     
    659668      sk = regfi_parse_sk(f, cur_elem->offset+j,
    660669                          cur_elem->length-j, false);
     670      printMsgs(f);
     671
    661672      if(sk != NULL)
    662673      {
     
    741752    bailOut(EX_NOINPUT, "");
    742753  }
     754  if(print_verbose)
     755    regfi_set_message_mask(f, REGFI_MSG_ERROR|REGFI_MSG_WARN|REGFI_MSG_INFO);
     756  else
     757    regfi_set_message_mask(f, REGFI_MSG_ERROR);
    743758
    744759  if(print_header)
Note: See TracChangeset for help on using the changeset viewer.