diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-03-25 09:43:27 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-03-25 09:43:27 +0100 |
commit | 9a797e37f07ca227eb2153437fa7d894cab4c244 (patch) | |
tree | 325ef1175e06458eacaf999ce1ada0d98bc20681 /src/log | |
parent | 0d4fb3da116f6e6704bb8bafe11f4ff865ec6aea (diff) | |
download | wolfbones-9a797e37f07ca227eb2153437fa7d894cab4c244.tar.gz wolfbones-9a797e37f07ca227eb2153437fa7d894cab4c244.tar.bz2 |
reverted strerror and GetLastError way of logging, doesn't work that way!
Diffstat (limited to 'src/log')
-rw-r--r-- | src/log/log.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/log/log.c b/src/log/log.c index d8b7e20..e63194b 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -705,6 +705,8 @@ void wolf_log_reopenlogtoeventlog( void ) { } #endif /* defined HAVE_EVENTLOG */ +static void wolf_log_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ); + void wolf_log( wolf_log_level_t level, int category_id, int message_id, const char *format, ... ) { va_list ap; @@ -713,7 +715,7 @@ void wolf_log( wolf_log_level_t level, int category_id, int message_id, const ch va_end( ap ); } -void wolf_log_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ) { +static void wolf_log_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ) { char s[1024]; vsnprintf( s, 1024, format, ap ); @@ -780,17 +782,11 @@ void wolf_log_ap( wolf_log_level_t level, int category_id, int message_id, const #endif /* defined HAVE_EVENTLOG */ } -#if defined _WIN32 +#if 0 -void wolf_log_win32( wolf_log_level_t level, int category_id, int message_id, const char *format, ... ) { - va_list ap; +static void wolf_log_win32_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ); - va_start( ap, format ); - wolf_log_win32_ap( level, category_id, message_id, format, ap ); - va_end( ap ); -} - -void wolf_log_win32_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ) { +static void wolf_log_win32_ap( wolf_log_level_t level, int category_id, int message_id, const char *format, va_list ap ) { DWORD last_error = GetLastError( ); LPVOID buf; DWORD buf_size; @@ -824,13 +820,11 @@ void wolf_log_win32_ap( wolf_log_level_t level, int category_id, int message_id, wolf_log_ap( level, category_id, message_id, new_format, ap ); } -#endif /* defined _WIN32 */ - -void wolf_log_strerror( wolf_log_level_t level, int category_id, int message_id, const char *format, ... ) { +void wolf_log_win32( wolf_log_level_t level, int category_id, int message_id, const char *format, ... ) { va_list ap; va_start( ap, format ); - wolf_log_strerror_ap( level, category_id, message_id, format, ap ); + wolf_log_win32_ap( level, category_id, message_id, format, ap ); va_end( ap ); } @@ -851,3 +845,5 @@ void wolf_log_strerror_ap( wolf_log_level_t level, int category_id, int message_ wolf_log_ap( level, category_id, message_id, new_format, ap ); } + +#endif |