tweak colors on windows to match unix

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9017 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-07-14 17:09:47 +00:00
parent b46693e3ca
commit 6687f151e7
3 changed files with 19 additions and 28 deletions

View File

@ -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 @@ SWITCH_BEGIN_EXTERN_C
#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

View File

@ -42,21 +42,13 @@ static int COLORIZE = 0;
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;

View File

@ -68,22 +68,12 @@ static switch_bool_t COLORIZE = SWITCH_FALSE;
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
};
#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, ""
};
#endif
static WORD
#else
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)
{