added NSIS_CONFIG_LOG_STDOUT

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4510 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-01-27 17:53:00 +00:00
parent cfec122ba1
commit 94f7f3b673
11 changed files with 45 additions and 10 deletions

View file

@ -9,7 +9,7 @@
#include "ui.h"
#ifdef NSIS_CONFIG_LOG
#ifndef NSIS_CONFIG_LOG_ODS
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
char g_log_file[1024];
#endif
#endif
@ -730,7 +730,7 @@ void NSISCALL validate_filename(char *in) {
int log_dolog;
char log_text[NSIS_MAX_STRLEN*4];
#ifndef NSIS_CONFIG_LOG_ODS
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
void NSISCALL log_write(int close)
{
static HANDLE fp=INVALID_HANDLE_VALUE;
@ -759,7 +759,7 @@ void NSISCALL log_write(int close)
}
}
}
#endif//!NSIS_CONFIG_LOG_ODS
#endif//!NSIS_CONFIG_LOG_ODS && !NSIS_CONFIG_LOG_STDOUT
const char * _RegKeyHandleToName(HKEY hKey)
{
@ -817,7 +817,16 @@ void log_printf(char *format, ...)
#ifdef NSIS_CONFIG_LOG_ODS
if (log_dolog)
OutputDebugString(log_text);
#else
#endif
#ifdef NSIS_CONFIG_LOG_STDOUT
if (GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE)
{
DWORD dwBytes;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), log_text, lstrlen(log_text), &dwBytes, NULL);
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "\n", 1, &dwBytes, NULL);
}
#endif
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
log_write(0);
#endif
}