When provided with a custome identifier, use that string instead of the port/PID as the last part of the baseName.

This commit is contained in:
Xin Dong 2020-03-31 11:02:02 -07:00
parent 03e2102a21
commit 2805111a32
1 changed files with 1 additions and 1 deletions

View File

@ -726,7 +726,7 @@ void openTraceFile(const NetworkAddress& na, uint64_t rollsize, uint64_t maxLogs
std::replace(ip.begin(), ip.end(), ':', '_'); // For IPv6, Windows doesn't accept ':' in filenames.
std::string baseName;
if (identifier.size() > 0) {
baseName = format("%s.%s.%s.%d", identifier.c_str(), baseOfBase.c_str(), ip.c_str(), na.port);
baseName = format("%s.%s.%s", baseOfBase.c_str(), ip.c_str(), identifier.c_str());
} else {
baseName = format("%s.%s.%d", baseOfBase.c_str(), ip.c_str(), na.port);
}