📄 logcontrol.cpp
字号:
#include "stdafx.h"
#include "logcontrol.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
namespace stk
{
LogControl::LogControl()
: m_logger(0)
{
}
LogControl::~LogControl()
{
disableTrace();
}
// switch low level debug trace
void LogControl::enableTrace(const char *traceFile)
{
assert(traceFile);
delete m_logger;
m_logger = new TLog(traceFile, "");
m_logger->open();
}
void LogControl::disableTrace()
{
delete m_logger;
m_logger = 0;
}
void LogControl::trace(int id, const char *fmt, ...)
{
if(m_logger)
{
va_list arg;
va_start(arg, fmt);
m_logger->vprint(id, fmt, arg);
va_end(arg);
}
}
void LogControl::traceBinary(int id, const char *title, const char *binary, int length)
{
if(m_logger)
{
m_logger->printb((unsigned int)id, title, (const unsigned char *)binary, length);
}
}
void LogControl::flush()
{
if(m_logger)
m_logger->flush();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -