Unix log colors and log decoration change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Benny,

I think I missed one thing. PJSUA has its own log configuration so it
needs to be configured there as well. And I think that pjsua_perror
should log at level 1 if I understand it correctly. So with these
changes you should see the colors if they work in console.

Here is the patch for those:
Index: pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjsip/src/pjsua-lib/pjsua_core.c    (revision 2092)
+++ pjsip/src/pjsua-lib/pjsua_core.c    (working copy)
@@ -40,7 +40,7 @@
     char errmsg[PJ_ERR_MSG_SIZE];

     pj_strerror(status, errmsg, sizeof(errmsg));
-    PJ_LOG(3,(sender, "%s: %s [status=%d]", title, errmsg, status));
+    PJ_LOG(1,(sender, "%s: %s [status=%d]", title, errmsg, status));
 }


@@ -69,7 +69,8 @@
     cfg->level = 5;
     cfg->console_level = 4;
     cfg->decor = PJ_LOG_HAS_SENDER | PJ_LOG_HAS_TIME |
-                PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE;
+                PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE |
+                PJ_LOG_HAS_SPACE | PJ_LOG_HAS_COLOR;
 }

 PJ_DEF(void) pjsua_logging_config_dup(pj_pool_t *pool,


Cheers,
Ondrej

P.S.: I am thinking about one last change; to change macros CLR_* to
unsigned variables to be able to change color of logs during runtime
(for example for dark and light background)

On Tue, Jul 1, 2008 at 17:59, Benny Prijono <bennylp at pjsip.org> wrote:
> Hi Ondrej,
>
> Sorry for the late response. I tried your patch (pjsua on Linux
> running over ssh) and I couldn't see the color. :(
>
> All I see is just gray for all log levels. Is there something that I missed?
>
> Cheers
>  Benny



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux