Beautify GraphiteWriter debug logging

refs #6550
This commit is contained in:
Gerd von Egidy 2014-08-05 00:53:18 +02:00 committed by Gunnar Beutner
parent a4b7984719
commit de5485060e
1 changed files with 5 additions and 2 deletions

View File

@ -169,10 +169,13 @@ void GraphiteWriter::SendPerfdata(const String& prefix, const CheckResult::Ptr&
void GraphiteWriter::SendMetric(const String& prefix, const String& name, double value)
{
std::ostringstream msgbuf;
msgbuf << prefix << "." << name << " " << Convert::ToString(value) << " " << static_cast<long>(Utility::GetTime()) << "\n";
msgbuf << prefix << "." << name << " " << Convert::ToString(value) << " " << static_cast<long>(Utility::GetTime());
Log(LogDebug, "GraphiteWriter", "Add to metric list:'" + msgbuf.str() + "'.");
// do not send \n to debug log
msgbuf << "\n";
String metric = msgbuf.str();
Log(LogDebug, "GraphiteWriter", "GraphiteWriter: Add to metric list:'" + metric + "'.");
ObjectLock olock(this);