- 论坛徽章:
- 9
|
ShowLog(1,"%s:epoll_wait err=%d,%s",__FUNCTION__,errno,strerror(errno));
完全可以简化, warn_message_str(str_msg), 只需要一个参数 呵呵呵
#define warn_message_str(str_msg) warning_message1((__FILE__),(__LINE__),(__FUNCTION__),(str_msg.c_str()))
void append_str_msg_error(std::string &str_msg, int int_errno)
{
if( int_errno==0) return;
std::string str_error = strerror( int_errno ) ;
if( str_error.length()>0) {
str_msg += "error=";
str_msg += str_error;
str_msg += ", errno=";
str_msg += std::to_string(int_errno);
return;
}
str_msg += "errno=";
str_msg += std::to_string(int_errno);
return;
} |
|