From 97dad7b3534fd42ed30a2c5d7e67042247bd1bb9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 14 Jul 2008 13:44:25 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9012 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_log.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/switch_log.c b/src/switch_log.c index 4edb5d27b4..3a43ef0f9a 100644 --- a/src/switch_log.c +++ b/src/switch_log.c @@ -331,7 +331,14 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char #endif if (aok) { if (COLORIZE) { + +#ifdef WIN32 + SetConsoleTextAttribute(hStdout, COLORS[node->level]); + WriteFile(hStdout, node->data, (DWORD) strlen(node->data), NULL, NULL); + SetConsoleTextAttribute(hStdout, wOldColorAttrs); +#else fprintf(handle, "%s%s%s", COLORS[level], data, SWITCH_SEQ_DEFAULT_COLOR); +#endif } else { fprintf(handle, "%s", data); }