DragonNest/Server/ServiceManagerEx/LogViewDisplayer.cpp
2024-12-20 16:56:44 +08:00

31 lines
No EOL
1.2 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "StdAfx.h"
#include "LogViewDisplayer.h"
#include "LogSplit.h"
#include "LogBuilder.h"
CLogViewDisplayer::CLogViewDisplayer(CLogSplit* pLogView)
: m_pLogView(pLogView)
{
}
CLogViewDisplayer::~CLogViewDisplayer()
{
}
void CLogViewDisplayer::Display(LogType::eLogType type, const wchar_t* buf)
{
if (!m_pLogView)
return;
tm *tm_ptr;
time_t raw;
time(&raw);
tm_ptr = localtime(&raw);
wchar_t date[256];
wcsftime(date, 256, L"%Y-%m-%d %H:%M:%S", tm_ptr);
wstring typeStr = CLogBuilder::TypeToString(type);
m_pLogView->InsertLog(LogInfo(date, typeStr, buf));
}