AppleWin/source/Log.h
Kelvin Lee 9a3832084a
Simplify the common combination of sprintf() and OutputDebugString() (PR #1031)
- Update LogOutput() and LogFileOutput().
- Add StrFormat() to produce std::string out of snprintf() & add StrFormat.cpp to projects.
- Add PTRDIFF_T_FMT in parallel to SIZE_T_FMT to StdAfx.h, for completeness.
- In Log.cpp, changed to get timestamp using posix functions.
- Removed TCHAR usage throughout - simply use char.
2022-02-13 21:37:05 +00:00

22 lines
490 B
C

#pragma once
#include <cstdio>
#include "StrFormat.h"
#ifndef _VC71 // __VA_ARGS__ not supported on MSVC++ .NET 7.x
#ifdef _DEBUG
#define LOG(format, ...) LogOutput(format, __VA_ARGS__)
#else
#define LOG(...)
#endif
#endif
extern FILE* g_fh; // File handle for log file
void LogInit(void);
void LogDone(void);
void LogOutput(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
void LogFileOutput(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);