Changeset 2400


Ignore:
Timestamp:
05/12/2008 20:36:21 (3 years ago)
Author:
chris
Message:

Add BOX_LOG_NATIVE_ERROR and BOX_LOG_NATIVE_WARNING macros, which call
BOX_LOG_SYS_* or BOX_LOG_WIN_* depending on platform, as this is a
common reason for #ifdefs elsewhere in the code.

Add BOX_LOG_SOCKET_ERROR macro to log socket errors with the type,
name and port of the socket that suffered the error.

File:
1 edited

Legend:

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

    r2391 r2400  
    6868        #define BOX_LOG_WIN_WARNING_NUMBER(stuff, number) \ 
    6969                BOX_WARNING(stuff << ": " << GetErrorMessage(number)) 
     70        #define BOX_LOG_NATIVE_ERROR(stuff)   BOX_LOG_WIN_ERROR(stuff) 
     71        #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_WIN_WARNING(stuff) 
     72#else 
     73        #define BOX_LOG_NATIVE_ERROR(stuff)   BOX_LOG_SYS_ERROR(stuff) 
     74        #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_SYS_WARNING(stuff) 
    7075#endif 
     76 
     77#define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ 
     78        BOX_LOG_NATIVE_ERROR(stuff << " (type " << _type << ", name " << \ 
     79                _name << ", port " << _port << ")") 
    7180 
    7281#define BOX_FORMAT_HEX32(number) \ 
Note: See TracChangeset for help on using the changeset viewer.