Add properties to Stream info

This commit is contained in:
badaix 2021-06-03 22:57:45 +02:00
parent edaa218414
commit 5a3559e8e4
2 changed files with 7 additions and 6 deletions

View file

@ -44,7 +44,7 @@ Server::~Server() = default;
void Server::onNewSession(const std::shared_ptr<StreamSession>& session) void Server::onNewSession(const std::shared_ptr<StreamSession>& session)
{ {
LOG(INFO, LOG_TAG) << "onNewSession\n"; LOG(DEBUG, LOG_TAG) << "onNewSession\n";
streamServer_->addSession(session); streamServer_->addSession(session);
} }
@ -57,7 +57,7 @@ void Server::onMetaChanged(const PcmStream* pcmStream)
const auto meta = pcmStream->getMeta(); const auto meta = pcmStream->getMeta();
LOG(DEBUG, LOG_TAG) << "metadata = " << meta->msg.dump(3) << "\n"; LOG(DEBUG, LOG_TAG) << "metadata = " << meta->msg.dump(3) << "\n";
LOG(INFO, LOG_TAG) << "onMetaChanged (" << pcmStream->getName() << ")\n"; LOG(DEBUG, LOG_TAG) << "onMetaChanged (" << pcmStream->getName() << ")\n";
streamServer_->onMetaChanged(pcmStream, meta); streamServer_->onMetaChanged(pcmStream, meta);
@ -70,7 +70,7 @@ void Server::onMetaChanged(const PcmStream* pcmStream)
void Server::onPropertiesChanged(const PcmStream* pcmStream) void Server::onPropertiesChanged(const PcmStream* pcmStream)
{ {
LOG(INFO, LOG_TAG) << "onPropertiesChanged (" << pcmStream->getName() << ")\n"; LOG(DEBUG, LOG_TAG) << "onPropertiesChanged (" << pcmStream->getName() << ")\n";
const auto props = pcmStream->getProperties(); const auto props = pcmStream->getProperties();
// Send propeties to all connected control clients // Send propeties to all connected control clients

View file

@ -82,11 +82,10 @@ void CtrlScript::send(const std::string& msg)
void CtrlScript::logScript(std::string line) void CtrlScript::logScript(std::string line)
{ {
if (line.empty())
return;
if (line.back() == '\r') if (line.back() == '\r')
line.resize(line.size() - 1); line.resize(line.size() - 1);
if (line.empty())
return;
auto tmp = utils::string::tolower_copy(line); auto tmp = utils::string::tolower_copy(line);
AixLog::Severity severity = AixLog::Severity::info; AixLog::Severity severity = AixLog::Severity::info;
if (tmp.find(" trace") != string::npos) if (tmp.find(" trace") != string::npos)
@ -381,6 +380,8 @@ json PcmStream::toJson() const
if (meta_) if (meta_)
j["meta"] = meta_->msg; j["meta"] = meta_->msg;
if (properties_)
j["properties"] = properties_->toJson();
return j; return j;
} }