From: miker Date: Sat, 16 Jun 2007 23:58:35 +0000 (+0000) Subject: Patch from Scott McKellar to add stderr logging when config (and thus configured... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a21f6104317a54975c2991a4b48feb956f5212ef;p=opensrf%2Fbjwebb.git Patch from Scott McKellar to add stderr logging when config (and thus configured logging) is unavailable: If osrfConfigInit() is unable to load the configuration file, it issues error messages to the log. Unfortunately, if we can't load the configuration file, we don't know where the log file is. The usual result is that the messages don't go anywhere. At best, depending on some convoluted details that aren't worth going into here, the messages will go to an obscure system-wide syslog file that only a hardened system administrator could love. In this patch I send similar messages to standard error, so that someone can see them. It might make sense to delete the calls to osrfLogWarning(), but I left them alone. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@953 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libstack/osrfConfig.c b/src/libstack/osrfConfig.c index 7d03521..b02b6fd 100644 --- a/src/libstack/osrfConfig.c +++ b/src/libstack/osrfConfig.c @@ -45,7 +45,8 @@ osrfConfig* osrfConfigInit(char* configFile, char* configContext) { xmlDocPtr doc = xmlParseFile(configFile); if(!doc) { - osrfLogWarning( OSRF_LOG_MARK, "Unable to parse XML config file %s", configFile); + fprintf( stderr, "osrfConfigInit: Unable to parse XML config file %s\n", configFile); + osrfLogWarning( OSRF_LOG_MARK, "Unable to parse XML config file %s", configFile); return NULL; } @@ -55,6 +56,7 @@ osrfConfig* osrfConfigInit(char* configFile, char* configContext) { xmlFreeDoc(doc); if(!json_config ) { + fprintf( stderr, "osrfConfigInit: xmlDocToJSON failed for config %s\n", configFile); osrfLogWarning( OSRF_LOG_MARK, "xmlDocToJSON failed for config %s", configFile); return NULL; }