log shairport messages

This commit is contained in:
badaix 2016-11-09 23:55:41 +01:00
parent f897fd7076
commit 60ed5b46d4

View file

@ -69,9 +69,11 @@ void AirplayStream::initExeAndPath(const std::string& filename)
void AirplayStream::onStderrMsg(const char* buffer, size_t n) void AirplayStream::onStderrMsg(const char* buffer, size_t n)
{ {
string logmsg = trim_copy(string(buffer, n)); string logmsg = trim_copy(string(buffer, n));
if (logmsg.empty())
return;
logO << "(" << exe_ << ") " << logmsg << "\n";
if (logmsg.find("Is another Shairport Sync running on this device") != string::npos) if (logmsg.find("Is another Shairport Sync running on this device") != string::npos)
{ {
logO << logmsg << "\n";
logE << "Seem there is another Shairport Sync runnig on port " << port_ << ", switching to port " << port_ + 1 << "\n"; logE << "Seem there is another Shairport Sync runnig on port " << port_ << ", switching to port " << port_ + 1 << "\n";
++port_; ++port_;
params_ = params_wo_port_ + " --port=" + cpt::to_string(port_); params_ = params_wo_port_ + " --port=" + cpt::to_string(port_);