mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-06 05:12:26 +08:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user