From ef7f203672db92383f2692fc9e748e2266535a79 Mon Sep 17 00:00:00 2001 From: whottgen <> Date: Mon, 8 Nov 2004 21:00:38 +0000 Subject: [PATCH] stats to syslog --- smmapdfw/libsmmapdfw/stats.c | 33 ++++++++++++++++++++++++++------- smmapdfw/libsmmapdfw/stats.h | 2 +- smmapdfw/smmapd/smmapd.c | 5 +++-- smmapdfw/smmapd/smmapd.ini | 4 +++- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/smmapdfw/libsmmapdfw/stats.c b/smmapdfw/libsmmapdfw/stats.c index 56195b7..08889e2 100644 --- a/smmapdfw/libsmmapdfw/stats.c +++ b/smmapdfw/libsmmapdfw/stats.c @@ -20,6 +20,7 @@ #include +#include #include "config.h" @@ -66,21 +67,39 @@ void decStatCounter(int cnt_idx) { #endif } -void outputStats(int nice) { +void outputStats(int stdout_nice, int syslog_nice) { #if ENABLE_STATS==1 - int i; + char buf[1024]; + char buf2[64]; + int i, v; - if (nice) + *buf = '\0'; + *buf2 = '\0'; + + strcat(buf, "Stats: "); + + if (2 == stdout_nice) printf("---------------------------------------------------------\n"); for (i=1; i