Azure IoT common library
Fork of azure_c_shared_utility by
Diff: xlogging.c
- Revision:
- 27:8656a313842b
- Parent:
- 25:8507bf644fdf
--- a/xlogging.c Mon May 08 10:51:21 2017 -0700 +++ b/xlogging.c Mon May 22 10:35:55 2017 -0700 @@ -10,7 +10,7 @@ #ifdef WINCE #include <stdarg.h> -void consolelogger_log(LOG_CATEGORY log_category, const char* file, const char* func, const int line, unsigned int options, const char* format, ...) +void consolelogger_log(LOG_CATEGORY log_category, const char* file, const char* func, int line, unsigned int options, const char* format, ...) { va_list args; va_start(args, format); @@ -42,7 +42,6 @@ LOGGER_LOG global_log_function = consolelogger_log; - void xlogging_set_log_function(LOGGER_LOG log_function) { global_log_function = log_function; @@ -53,6 +52,21 @@ return global_log_function; } +#if (defined(_MSC_VER)) && (!(defined WINCE)) + +LOGGER_LOG_GETLASTERROR global_log_function_GetLastError = consolelogger_log_with_GetLastError; + +void xlogging_set_log_function_GetLastError(LOGGER_LOG_GETLASTERROR log_function_GetLastError) +{ + global_log_function_GetLastError = log_function_GetLastError; +} + +LOGGER_LOG_GETLASTERROR xlogging_get_log_function_GetLastError(void) +{ + return global_log_function_GetLastError; +} +#endif + /* Print up to 16 bytes per line. */ #define LINE_SIZE 16