From c51c748a173e34569178fea133571ee5f1a33bbb Mon Sep 17 00:00:00 2001 From: crs Date: Mon, 27 Sep 2004 21:04:37 +0000 Subject: [PATCH] Server now reports configuration file errors as ERROR level log messages rather than DEBUG level. Missing files are still reported as DEBUG level messages since we expect some to be missing. --- cmd/synergys/synergys.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/synergys/synergys.cpp b/cmd/synergys/synergys.cpp index c5c45e51..b9464fb3 100644 --- a/cmd/synergys/synergys.cpp +++ b/cmd/synergys/synergys.cpp @@ -815,14 +815,20 @@ loadConfig(const CString& pathname) LOG((CLOG_DEBUG "opening configuration \"%s\"", pathname.c_str())); std::ifstream configStream(pathname.c_str()); if (!configStream.is_open()) { - throw XConfigRead("cannot open file"); + // report failure to open configuration as a debug message + // since we try several paths and we expect some to be + // missing. + LOG((CLOG_DEBUG "cannot open configuration \"%s\"", + pathname.c_str())); + return false; } configStream >> *ARG->m_config; LOG((CLOG_DEBUG "configuration read successfully")); return true; } catch (XConfigRead& e) { - LOG((CLOG_DEBUG "cannot read configuration \"%s\": %s", + // report error in configuration file + LOG((CLOG_ERR "cannot read configuration \"%s\": %s", pathname.c_str(), e.what())); } return false;