Ignore:
Timestamp:
28/03/2008 22:18:44 (4 years ago)
Author:
chris
Message:

Improve logging with macros that consistently output strerror(errno) and
errno, replacing almost all use of strerror() in the main code.

Log a more detailed error message before throwing an exception for some
more system call failures.

Make FileStream? store its filename on all platforms, not just Windows.

Wrap some long lines at less than 80 characters to improve readability.

Fix some minor violations of coding standard (white space) and a typo
in a comment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r2109 r2115  
    18131813#endif // HAVE_STRUCT_STATVFS_F_MNTONNAME 
    18141814                                { 
    1815                                         BOX_WARNING("Failed to stat location " 
     1815                                        BOX_LOG_SYS_WARNING("Failed to stat location " 
    18161816                                                "path '" << apLoc->mPath << 
    1817                                                 "' (" << strerror(errno) << 
    1818                                                 "), skipping location '" << 
     1817                                                "', skipping location '" << 
    18191818                                                apLoc->mName << "'"); 
    18201819                                        continue; 
     
    21902189                if(::rename(newmap.c_str(), target.c_str()) != 0) 
    21912190                { 
    2192                         BOX_ERROR("failed to rename ID map: " << newmap 
    2193                                 << " to " << target << ": "  
    2194                                 << strerror(errno)); 
     2191                        BOX_LOG_SYS_ERROR("Failed to rename ID map: " << 
     2192                                newmap << " to " << target); 
    21952193                        THROW_EXCEPTION(CommonException, OSFileError) 
    21962194                } 
     
    30563054        if(!FileExists(storeObjectInfoFile.c_str())) 
    30573055        { 
    3058                 // File doesn't exist -- so can't be deleted. But something isn't quite right, so log a message 
    3059                 BOX_WARNING("Store object info file did not exist when it " 
    3060                         "was supposed to. (" << storeObjectInfoFile << ")"); 
     3056                // File doesn't exist -- so can't be deleted. But something 
     3057                // isn't quite right, so log a message 
     3058                BOX_WARNING("StoreObjectInfoFile did not exist when it " 
     3059                        "was supposed to: " << storeObjectInfoFile); 
    30613060 
    30623061                // Return true to stop things going around in a loop 
     
    30673066        if(::unlink(storeObjectInfoFile.c_str()) != 0) 
    30683067        { 
    3069                 BOX_ERROR("Failed to delete the old store object info file: " 
    3070                         << storeObjectInfoFile << ": "<< strerror(errno)); 
     3068                BOX_LOG_SYS_ERROR("Failed to delete the old " 
     3069                        "StoreObjectInfoFile: " << storeObjectInfoFile); 
    30713070                return false; 
    30723071        } 
Note: See TracChangeset for help on using the changeset viewer.