From 10896d4b728de5963c4bcad04a01d720f3ad8183 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Thu, 20 Nov 2008 19:47:16 -0500 Subject: [PATCH] vxodbc: LogMoniker-related cleanups. We shouldn't add the log stream to the globallist since we're not actually supposed to select() on it. We now print a message to the log right away on startup, so we know logging is working at all. Link to WvConStream so that "stdout" and "stderr" LogMonikers work. --- vxodbc/wvlogger.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vxodbc/wvlogger.cc b/vxodbc/wvlogger.cc index 4e0c086..4b634a7 100644 --- a/vxodbc/wvlogger.cc +++ b/vxodbc/wvlogger.cc @@ -15,6 +15,7 @@ static WvLogRcv *rcv = NULL; int log_level = 0; static WvString log_moniker; +WV_LINK_TO(WvConStream); WV_LINK_TO(WvTCPConn); WV_LINK_TO(WvSSLStream); WV_LINK_TO(WvGzipStream); @@ -67,13 +68,14 @@ void wvlog_open() IWvStream *s = wvcreate(log_moniker); assert(s); - WvIStreamList::globallist.append(s, false, "VxODBC logger"); rcv = new WvLogStream(s, pri); if (!wvlog) wvlog = new WvLog(getpid(), WvLog::Debug); } else // We want this to also capture (and eliminate) DBus messages. rcv = new WvNullRcv(); + + (*wvlog)(WvLog::Info, "Log initialized.\n"); } @@ -90,6 +92,7 @@ void wvlog_print(const char *file, int line, const char *s) void wvlog_close() { + if (wvlog) (*wvlog)(WvLog::Info, "Log closing.\n"); if (wvlog) delete wvlog; if (rcv) delete rcv; wvlog = NULL; -- 2.11.4.GIT