From: scottmk Date: Mon, 3 May 2010 02:23:59 +0000 (+0000) Subject: Set the appname to the logging routines at the beginning of X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3e175e856c6348e17aa6bc2ecddb958597f4d1a4;p=working%2FOpenSRF.git Set the appname to the logging routines at the beginning of osrfAppRegisterApplication() instead of at the end, so that messages issued during initialization of the application will be properly identified. This change particularly affects apps that do a lot of initialization, such as cstore, rstore, and pcrud. M src/libopensrf/osrf_application.c git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1952 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libopensrf/osrf_application.c b/src/libopensrf/osrf_application.c index e90f64d..836f73b 100644 --- a/src/libopensrf/osrf_application.c +++ b/src/libopensrf/osrf_application.c @@ -90,10 +90,12 @@ static osrfHash* _osrfAppHash = NULL; appear in subsequent log messages. */ int osrfAppRegisterApplication( const char* appName, const char* soFile ) { - if(!appName || ! soFile) return -1; + if( !appName || ! soFile ) return -1; char* error; - if(!_osrfAppHash) + osrfLogSetAppname( appName ); + + if( !_osrfAppHash ) _osrfAppHash = osrfNewHash(); osrfLogInfo( OSRF_LOG_MARK, "Registering application %s with file %s", appName, soFile ); @@ -137,8 +139,6 @@ int osrfAppRegisterApplication( const char* appName, const char* soFile ) { osrfLogInfo( OSRF_LOG_MARK, "Application %s registered successfully", appName ); - osrfLogSetAppname(appName); - osrfAppSetOnExit(app, appName); return 0;