[Freeswitch-svn] [commit] r9017 - in freeswitch/trunk/src: . include mod/loggers/mod_console
Freeswitch SVN
mikej at freeswitch.org
Mon Jul 14 13:09:48 EDT 2008
Author: mikej
Date: Mon Jul 14 13:09:47 2008
New Revision: 9017
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c
freeswitch/trunk/src/switch_log.c
Log:
tweak colors on windows to match unix
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Mon Jul 14 13:09:47 2008
@@ -38,6 +38,14 @@
#include <switch.h>
SWITCH_BEGIN_EXTERN_C
#define SWITCH_BLANK_STRING ""
+#ifdef WIN32
+#define SWITCH_SEQ_FWHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
+#define SWITCH_SEQ_FRED FOREGROUND_RED | FOREGROUND_INTENSITY
+#define SWITCH_SEQ_FMAGEN FOREGROUND_BLUE | FOREGROUND_RED
+#define SWITCH_SEQ_FCYAN FOREGROUND_GREEN | FOREGROUND_BLUE
+#define SWITCH_SEQ_FGREEN FOREGROUND_GREEN
+#define SWITCH_SEQ_FYELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
+#else
#define SWITCH_SEQ_ESC "\033["
/* Ansi Control character suffixes */
#define SWITCH_SEQ_HOME_CHAR 'H'
@@ -91,6 +99,7 @@
#define SWITCH_SEQ_CLEARLINE SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINE_CHAR_STR
#define SWITCH_SEQ_CLEARLINEEND SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINEEND_CHAR
#define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME
+#endif
#define SWITCH_DEFAULT_DTMF_DURATION 2000
#define SWITCH_MAX_DTMF_DURATION 192000
#define SWITCH_DEFAULT_DIR_PERMS SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE
Modified: freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c (original)
+++ freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c Mon Jul 14 13:09:47 2008
@@ -42,21 +42,13 @@
static HANDLE hStdout;
static WORD wOldColorAttrs;
static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-static WORD COLORS[] = { FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY
-};
+
+static WORD
#else
-static const char *COLORS[] = { SWITCH_SEQ_FWHITE, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FMAGEN, SWITCH_SEQ_FCYAN,
- SWITCH_SEQ_FGREEN, SWITCH_SEQ_FYELLOW, ""
-};
+static const char*
#endif
+COLORS[] = { SWITCH_SEQ_FWHITE, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FMAGEN, SWITCH_SEQ_FCYAN, SWITCH_SEQ_FGREEN, SWITCH_SEQ_FYELLOW };
+
static switch_memory_pool_t *module_pool = NULL;
static switch_hash_t *log_hash = NULL;
Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c (original)
+++ freeswitch/trunk/src/switch_log.c Mon Jul 14 13:09:47 2008
@@ -68,22 +68,12 @@
static HANDLE hStdout;
static WORD wOldColorAttrs;
static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-static WORD COLORS[] = { FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_GREEN | FOREGROUND_INTENSITY
-};
+
+static WORD
#else
-static const char *COLORS[] = { SWITCH_SEQ_FWHITE, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FMAGEN, SWITCH_SEQ_FCYAN,
- SWITCH_SEQ_FGREEN, SWITCH_SEQ_FYELLOW, ""
-};
+static const char*
#endif
-
+COLORS[] = { SWITCH_SEQ_FWHITE, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FRED, SWITCH_SEQ_FMAGEN, SWITCH_SEQ_FCYAN, SWITCH_SEQ_FGREEN, SWITCH_SEQ_FYELLOW };
SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level_t level)
{
More information about the Freeswitch-svn
mailing list