mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10997 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e794ed9a8e
commit
58abcae22c
@ -83,30 +83,26 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
|||||||
|
|
||||||
if (!esl_strlen_zero(type)) {
|
if (!esl_strlen_zero(type)) {
|
||||||
if (!strcasecmp(type, "log/data")) {
|
if (!strcasecmp(type, "log/data")) {
|
||||||
int level = 0, tchannel = 0;
|
int level = 0;
|
||||||
const char *lname = esl_event_get_header(handle->last_event, "log-level");
|
const char *lname = esl_event_get_header(handle->last_event, "log-level");
|
||||||
const char *channel = esl_event_get_header(handle->last_event, "text-channel");
|
#ifdef WIN32
|
||||||
//const char *file = esl_event_get_header(handle->last_event, "log-file");
|
DWORD len = (DWORD) strlen(handle->last_event->body);
|
||||||
|
DWORD outbytes = 0;
|
||||||
if (channel) {
|
#endif
|
||||||
tchannel = atoi(channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lname) {
|
if (lname) {
|
||||||
level = atoi(lname);
|
level = atoi(lname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tchannel == 0) {
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD len = (DWORD) strlen(handle->last_event->body);
|
|
||||||
DWORD outbytes = 0;
|
SetConsoleTextAttribute(hStdout, COLORS[level]);
|
||||||
SetConsoleTextAttribute(hStdout, COLORS[level]);
|
WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
|
||||||
WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
|
SetConsoleTextAttribute(hStdout, wOldColorAttrs);
|
||||||
SetConsoleTextAttribute(hStdout, wOldColorAttrs);
|
|
||||||
#else
|
#else
|
||||||
printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
|
printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
known++;
|
known++;
|
||||||
} else if (!strcasecmp(type, "text/disconnect-notice")) {
|
} else if (!strcasecmp(type, "text/disconnect-notice")) {
|
||||||
running = thread_running = 0;
|
running = thread_running = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user