Ignore:
Timestamp:
10/02/2010 19:01:12 (2 years ago)
Author:
chris
Message:

Log more detailed info about backup comparison failures, for debugging.

Enable -V option in bbackupquery, and document that -q, -v, -V and
-W<level> are allowed in the command-line help.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/Logging.h

    r2544 r2604  
    1818 
    1919#include "FileStream.h" 
    20  
    21 /* 
    22 #define BOX_LOG(level, stuff) \ 
    23 { \ 
    24     if(Log::sMaxLoggingLevelForAnyOutput >= level) \ 
    25         std::ostringstream line; \ 
    26         line << stuff; \ 
    27         Log::Write(level, __FILE__, __LINE__, line.str()); \ 
    28     } \ 
    29 } 
    30 */ 
    3120 
    3221#define BOX_LOG(level, stuff) \ 
     
    5342        { BOX_LOG(Log::TRACE, stuff) } 
    5443 
     44#define BOX_SYS_ERROR(stuff) \ 
     45        stuff << ": " << std::strerror(errno) << " (" << errno << ")" 
     46 
    5547#define BOX_LOG_SYS_WARNING(stuff) \ 
    56         BOX_WARNING(stuff << ": " << std::strerror(errno) << " (" << errno << ")") 
     48        BOX_WARNING(BOX_SYS_ERROR(stuff)) 
    5749#define BOX_LOG_SYS_ERROR(stuff) \ 
    58         BOX_ERROR(stuff << ": " << std::strerror(errno) << " (" << errno << ")") 
     50        BOX_ERROR(BOX_SYS_ERROR(stuff)) 
    5951#define BOX_LOG_SYS_FATAL(stuff) \ 
    60         BOX_FATAL(stuff << ": " << std::strerror(errno) << " (" << errno << ")") 
     52        BOX_FATAL(BOX_SYS_ERROR(stuff)) 
     53 
     54#define LOG_AND_THROW_ERROR(message, filename, exception, subtype) \ 
     55        BOX_LOG_SYS_ERROR(message << ": " << filename); \ 
     56        THROW_EXCEPTION_MESSAGE(exception, subtype, \ 
     57                BOX_SYS_ERROR(message << ": " << filename)); 
    6158 
    6259inline std::string GetNativeErrorMessage() 
     
    340337}; 
    341338 
     339std::string PrintEscapedBinaryData(const std::string& rInput); 
     340 
    342341#endif // LOGGING__H 
Note: See TracChangeset for help on using the changeset viewer.