mirror of
https://github.com/libretro/Play-.git
synced 2025-01-25 10:37:56 +00:00
fdd1734ff0
git-svn-id: http://svn.purei.org/purei/trunk@197 b36208d7-6611-0410-8bec-b1987f11c4a2
47 lines
804 B
C++
47 lines
804 B
C++
#include <stdarg.h>
|
|
#include <time.h>
|
|
#include "Log.h"
|
|
|
|
#define LOG_PATH "./logs/"
|
|
|
|
using namespace Framework;
|
|
using namespace std;
|
|
|
|
CLog::CLog()
|
|
{
|
|
|
|
}
|
|
|
|
CLog::~CLog()
|
|
{
|
|
|
|
}
|
|
|
|
void CLog::Print(const char* logName, const char* format, ...)
|
|
{
|
|
#ifdef _DEBUG
|
|
CStdStream* log(GetLog(logName));
|
|
if(log == NULL) return;
|
|
va_list args;
|
|
va_start(args, format);
|
|
vfprintf(*log, format, args);
|
|
va_end(args);
|
|
log->Flush();
|
|
#endif
|
|
}
|
|
|
|
CStdStream* CLog::GetLog(const char* logName)
|
|
{
|
|
LogMapType::iterator logIterator(m_logs.find(logName));
|
|
if(logIterator != m_logs.end())
|
|
{
|
|
return logIterator->second;
|
|
}
|
|
else
|
|
{
|
|
CStdStream* log = new CStdStream((LOG_PATH + string(logName) + ".log").c_str(), "wb");
|
|
m_logs[logName] = log;
|
|
return log;
|
|
}
|
|
}
|