[Opensrf-commits] r1952 - trunk/src/libopensrf (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun May 2 22:24:01 EDT 2010
Author: scottmk
Date: 2010-05-02 22:23:59 -0400 (Sun, 02 May 2010)
New Revision: 1952
Modified:
trunk/src/libopensrf/osrf_application.c
Log:
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
Modified: trunk/src/libopensrf/osrf_application.c
===================================================================
--- trunk/src/libopensrf/osrf_application.c 2010-04-24 13:34:17 UTC (rev 1951)
+++ trunk/src/libopensrf/osrf_application.c 2010-05-03 02:23:59 UTC (rev 1952)
@@ -90,10 +90,12 @@
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 @@
osrfLogInfo( OSRF_LOG_MARK, "Application %s registered successfully", appName );
- osrfLogSetAppname(appName);
-
osrfAppSetOnExit(app, appName);
return 0;
More information about the opensrf-commits
mailing list