summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/log.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2020-01-12 16:52:10 +0100
committerXavier Simonart <xavier.simonart@intel.com>2020-01-29 12:39:41 +0100
commitd6e552774d85f07ec1a1195e06842daab3c1ef4f (patch)
tree96aba50f2e5d596ff927e0e58c2081e9facafbe6 /VNFs/DPPD-PROX/log.c
parent2cd03b79c4415b5b300bc9f3dde7057e2d31b2a2 (diff)
PROX: print panic message on screen
When PROX detects an error condition at startup, it calls PROX_PANIC which prints an message before calling rte_panic to end the application. If ncurses was already started, this results in the message being printed in ncurses (and prox.log) then leaving ncurses; hence the message is usually not visible to the user (until it open prox.log), giving the impression of an unexpected crash. With this fix, the error message is repeated after closing ncurses, hence the message will be printed on stdout. Note that it might also be printed twice on stdout if ncurses was not already started. As part of this fix, prox.log is now properly closed. Change-Id: If41875843f1a39bc715f4264b3992c3fa018394e Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/log.c')
-rw-r--r--VNFs/DPPD-PROX/log.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/log.c b/VNFs/DPPD-PROX/log.c
index b07076de..2094c185 100644
--- a/VNFs/DPPD-PROX/log.c
+++ b/VNFs/DPPD-PROX/log.c
@@ -81,6 +81,13 @@ void plog_init(const char *log_name, int log_name_pid)
tsc_off = rte_rdtsc() + 2500000000;
}
+void plog_end(void)
+{
+ if (fp)
+ fclose(fp);
+ fp = NULL;
+}
+
int plog_set_lvl(int lvl)
{
if (lvl <= PROX_MAX_LOG_LVL) {