mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
43 lines
774 B
C++
43 lines
774 B
C++
/** @file
|
|
*
|
|
* @par History
|
|
*/
|
|
|
|
|
|
#include "tracebuf.h"
|
|
|
|
#ifndef NDEBUG
|
|
#include "logfacility.h"
|
|
#include <format/format.h>
|
|
#endif
|
|
|
|
namespace Pol
|
|
{
|
|
namespace Clib
|
|
{
|
|
#ifndef NDEBUG
|
|
TraceBufferElem tracebuffer[TRACEBUF_DEPTH];
|
|
unsigned tracebuffer_insertpoint;
|
|
#endif
|
|
|
|
void LogTraceBuffer()
|
|
{
|
|
#ifndef NDEBUG
|
|
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";
|
|
}
|
|
tmp << "End of TraceBuffer.\n";
|
|
POLLOG << tmp.str();
|
|
#endif
|
|
}
|
|
}
|
|
}
|