Module: sip-router
Branch: master
Commit: 1c1bdda16c7643b882a437583368d97e33c21e56
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1c1bdda…
Author: Elena-Ramona Modroiu <ramona(a)asipto.com>
Committer: Elena-Ramona Modroiu <ramona(a)asipto.com>
Date: Mon Sep 3 08:52:26 2012 +0200
core: added function to update log level color scheme
---
dprint.c | 8 ++++++++
dprint.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dprint.c b/dprint.c
index 90dd110..12259d4 100644
--- a/dprint.c
+++ b/dprint.c
@@ -343,3 +343,11 @@ void dprint_color_reset(void)
dprint_term_color('x', 'x', &obuf);
fprintf(stderr, "%.*s", obuf.len, obuf.s);
}
+
+void dprint_color_update(int level, char f, char b)
+{
+ if(level<L_MIN || level>L_MAX)
+ return;
+ if(f && f!='0') _log_level_colors[level - L_MIN].f = f;
+ if(b && b!='0') _log_level_colors[level - L_MIN].b = b;
+}
diff --git a/dprint.h b/dprint.h
index 04179de..cddb490 100644
--- a/dprint.h
+++ b/dprint.h
@@ -139,6 +139,7 @@ int log_facility_fixup(void *handle, str *gname, str *name, void
**val);
void dprint_color(int level);
void dprint_color_reset(void);
+void dprint_color_update(int level, char f, char b);
void dprint_init_colors(void);
/** @brief