Machine Interface Utility:VER1.0
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#if !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_)
|
||||
#define LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_
|
||||
|
||||
#include <afxwin.h>
|
||||
#include <afxext.h>
|
||||
#include <wincon.h>
|
||||
#include <string.h>
|
||||
#include <share.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
const long LOGINIT = 0x0001;
|
||||
const long LOGACTIONS = 0x0002;
|
||||
const long LOGCOMM = 0x0004;
|
||||
const long LOGFLUSH = 0x0008;
|
||||
|
||||
class CLogger
|
||||
{
|
||||
public:
|
||||
|
||||
CLogger()
|
||||
{
|
||||
m_File = NULL;
|
||||
CString Path=_T(""); // Speed optimization - noticed slow in GlowCode
|
||||
if (Path.IsEmpty()) {
|
||||
CString tmpPath;
|
||||
GetModuleFileName(NULL,tmpPath.GetBuffer(255),255);
|
||||
tmpPath.ReleaseBuffer();
|
||||
tmpPath.TrimRight();
|
||||
int nLastSlash = tmpPath.ReverseFind('\\');
|
||||
if (nLastSlash >= 0)
|
||||
tmpPath = tmpPath.Left(nLastSlash);
|
||||
else
|
||||
tmpPath.Empty();
|
||||
Path=tmpPath;
|
||||
}
|
||||
m_FileName=Path + _T("\\Mv_SSILog.txt");
|
||||
m_lLogMask=0;
|
||||
};
|
||||
~CLogger()
|
||||
{
|
||||
if (m_File)
|
||||
fclose(m_File);
|
||||
};
|
||||
|
||||
void Send(LPCTSTR, ...);
|
||||
void SendAndFlush(LPCTSTR, ...);
|
||||
void SendAndFlushPerMode(LPCTSTR, ...);
|
||||
CString m_FileName;
|
||||
long m_lLogMask;
|
||||
FILE *m_File;
|
||||
_TCHAR m_Str[20000];
|
||||
_TCHAR m_Str2[20000];
|
||||
};
|
||||
|
||||
#endif // !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_)
|
||||
Reference in New Issue
Block a user