2016-01-28 14:52:40 +01:00
|
|
|
/** @file
|
|
|
|
|
*
|
|
|
|
|
* @par History
|
|
|
|
|
*/
|
2016-02-11 22:54:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "tracebuf.h"
|
|
|
|
|
|
2018-02-04 14:10:23 +01:00
|
|
|
#ifndef NDEBUG
|
2018-02-04 14:30:54 +01:00
|
|
|
#include "logfacility.h"
|
2018-02-04 14:10:23 +01:00
|
|
|
#include <format/format.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-02-19 19:26:35 +01:00
|
|
|
namespace Pol
|
|
|
|
|
{
|
|
|
|
|
namespace Clib
|
|
|
|
|
{
|
2016-02-11 22:54:43 +01:00
|
|
|
#ifndef NDEBUG
|
2016-02-19 19:26:35 +01:00
|
|
|
TraceBufferElem tracebuffer[TRACEBUF_DEPTH];
|
|
|
|
|
unsigned tracebuffer_insertpoint;
|
2016-02-11 22:54:43 +01:00
|
|
|
#endif
|
|
|
|
|
|
2016-02-19 19:26:35 +01:00
|
|
|
void LogTraceBuffer()
|
|
|
|
|
{
|
2016-02-11 22:54:43 +01:00
|
|
|
#ifndef NDEBUG
|
2016-02-19 19:26:35 +01:00
|
|
|
fmt::Writer tmp;
|
|
|
|
|
tmp << "TraceBuffer:\n";
|
|
|
|
|
for ( unsigned i = tracebuffer_insertpoint; i < TRACEBUF_DEPTH; ++i )
|
|
|
|
|
{
|
|
|
|
|
if ( tracebuffer[i].tag )
|
|
|
|
|
tmp << tracebuffer[i].tag << "=" << tracebuffer[i].value << "\n";
|
|
|
|
|
}
|
|
|
|
|
for ( unsigned i = 0; i < tracebuffer_insertpoint; ++i )
|
|
|
|
|
{
|
|
|
|
|
if ( tracebuffer[i].tag )
|
|
|
|
|
tmp << tracebuffer[i].tag << "=" << tracebuffer[i].value << "\n";
|
2016-02-11 22:54:43 +01:00
|
|
|
}
|
2016-02-19 19:26:35 +01:00
|
|
|
tmp << "End of TraceBuffer.\n";
|
|
|
|
|
POLLOG << tmp.str();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-29 21:55:48 +01:00
|
|
|
}
|