2007-03-23 22:26:35 +00:00
|
|
|
/*
|
|
|
|
AppleWin : An Apple //e emulator for Windows
|
|
|
|
|
|
|
|
Copyright (C) 1994-1996, Michael O'Brien
|
|
|
|
Copyright (C) 1999-2001, Oliver Schmidt
|
|
|
|
Copyright (C) 2002-2005, Tom Charlesworth
|
2007-04-01 15:24:52 +00:00
|
|
|
Copyright (C) 2006-2007, Tom Charlesworth, Michael Pohoreski, Nick Westgate
|
2007-03-23 22:26:35 +00:00
|
|
|
|
|
|
|
AppleWin is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
AppleWin is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with AppleWin; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Description: Log
|
|
|
|
*
|
|
|
|
* Author: Nick Westgate
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "StdAfx.h"
|
2010-02-14 21:11:26 +00:00
|
|
|
|
2007-03-23 22:26:35 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void LogOutput(LPCTSTR format, ...)
|
|
|
|
{
|
2015-07-30 16:21:31 +00:00
|
|
|
TCHAR output[256];
|
2007-03-23 22:26:35 +00:00
|
|
|
|
2015-07-30 16:21:31 +00:00
|
|
|
va_list args;
|
|
|
|
va_start(args, format);
|
2007-03-23 22:26:35 +00:00
|
|
|
|
2015-07-30 16:21:31 +00:00
|
|
|
_vsntprintf(output, sizeof(output) - 1, format, args);
|
|
|
|
OutputDebugString(output);
|
2007-03-23 22:26:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2013-03-18 23:17:18 +00:00
|
|
|
|
|
|
|
extern FILE* g_fh; // Filehandle for log file
|
|
|
|
|
|
|
|
void LogFileOutput(LPCTSTR format, ...)
|
|
|
|
{
|
|
|
|
if (!g_fh)
|
|
|
|
return;
|
|
|
|
|
2015-07-30 16:21:31 +00:00
|
|
|
TCHAR output[256];
|
2013-03-18 23:17:18 +00:00
|
|
|
|
2015-07-30 16:21:31 +00:00
|
|
|
va_list args;
|
|
|
|
va_start(args, format);
|
2013-03-18 23:17:18 +00:00
|
|
|
|
2015-07-30 16:21:31 +00:00
|
|
|
_vsntprintf(output, sizeof(output) - 1, format, args);
|
|
|
|
fprintf(g_fh, "%s", output);
|
2013-03-18 23:17:18 +00:00
|
|
|
}
|