- fixes in logging + allow ICENetworkAddress to be logged in short form
This commit is contained in:
parent
69374d2973
commit
37471d56ff
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue