diff --git a/src/libs/ice/ICEAddress.cpp b/src/libs/ice/ICEAddress.cpp index e10e14ac..856192a2 100644 --- a/src/libs/ice/ICEAddress.cpp +++ b/src/libs/ice/ICEAddress.cpp @@ -515,6 +515,18 @@ std::string NetworkAddress::toStdString() const return temp; } + +std::string NetworkAddress::toBriefStdString() const +{ + if (!mInitialized) + return ""; + + char temp[128]; + sprintf(temp, "%s:%u", ip().c_str(), (unsigned int)port()); + + return temp; +} + #ifdef WIN32 std::wstring NetworkAddress::toStdWString() const { diff --git a/src/libs/ice/ICEAddress.h b/src/libs/ice/ICEAddress.h index 34d46690..2fabb5ff 100644 --- a/src/libs/ice/ICEAddress.h +++ b/src/libs/ice/ICEAddress.h @@ -61,6 +61,7 @@ namespace ice unsigned short port() const; std::string toStdString() const; + std::string toBriefStdString() const; #ifdef WIN32 std::wstring toStdWString() const; #endif diff --git a/src/libs/ice/ICELog.cpp b/src/libs/ice/ICELog.cpp index 0e8a36a8..12e73704 100644 --- a/src/libs/ice/ICELog.cpp +++ b/src/libs/ice/ICELog.cpp @@ -211,8 +211,8 @@ Logger::endLine() struct tm current_time = *gmtime(&unix_timestamp); char time_buffer[128]; strftime(time_buffer, sizeof(time_buffer), "%H:%M:%S", ¤t_time); - result << time_buffer << ":" << (unix_timestamp_ms.count() % 1000 ) << "\t" << " | " << std::setw(8) << ThreadInfo::currentThread() << " | " << std::setw(30) - << mFilename.c_str() << " | " << std::setw(4) << mLine << " | " << std::setw(12) << mSubsystem.c_str() << " | " + result << time_buffer << ":" << (unix_timestamp_ms.count() % 1000 ) << "\t" << " | " << std::setw(8) << ThreadInfo::currentThread() << " | " + << std::setw(40) << mFilename.c_str() << " | " << std::setw(4) << mLine << " | " << std::setw(12) << mSubsystem.c_str() << " | " << mStream->str().c_str(); std::string t = result.str();