polserver/pol-core/pol/checkpnt.cpp

34 lines
618 B
C++
Raw Permalink Normal View History

/** @file
*
* @par History
*/
2016-02-11 22:54:43 +01:00
#include "checkpnt.h"
#include "../clib/logfacility.h"
#include "../plib/systemstate.h"
2016-02-11 22:54:43 +01:00
#include "globals/state.h"
namespace Pol
{
namespace Core
{
void checkpoint( const char* msg, unsigned short minlvl /* = 11 */ )
{
Core::stateManager.last_checkpoint = msg;
if ( Plib::systemstate.config.loglevel >= minlvl )
{
POLLOG_INFOLN( "checkpoint: {}", msg );
2016-02-11 22:54:43 +01:00
}
}
Checkpoint::Checkpoint( const char* file ) : _file( file ), _line( 0 ) {}
Checkpoint::~Checkpoint()
{
if ( _line )
POLLOG_ERRORLN( "Abnormal end after checkpoint: File {}, line {}", _file, _line );
}
}
}