Added prototypes and functions to initialize the logger client and associated mutex.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@594 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
dsandersoremutah
2006-06-20 18:32:08 +00:00
parent fb5945653d
commit 720fd25e8c
4 changed files with 67 additions and 0 deletions

View File

@@ -1372,6 +1372,9 @@
eLogMessageSeverity eMsgSeverity = F_DEBUG_MESSAGE) = 0;
};
void f_setLoggerClient(
IF_LoggerClient * pLogger);
/****************************************************************************
/// This is an abstract base class that allows an application to catch
/// messages. The application must create an implementation for this class

View File

@@ -1430,3 +1430,51 @@ void F_Trace::outputCurrentText(
m_pszDestStr = &m_szDestStr [0];
}
}
/****************************************************************************
Desc: Initialize the toolkit logger
****************************************************************************/
RCODE f_loggerInit( void)
{
RCODE rc = NE_FLM_OK;
if (RC_BAD( rc = f_mutexCreate( &gv_hLoggerMutex)))
{
goto Exit;
}
Exit:
return( rc);
}
/****************************************************************************
Desc: Shutdown the toolkit logger
****************************************************************************/
void f_loggerShutdown( void)
{
if (gv_pLogger)
{
gv_pLogger->Release();
gv_pLogger = NULL;
}
if (gv_hLoggerMutex != F_MUTEX_NULL)
{
f_mutexDestroy( &gv_hLoggerMutex);
}
}
void f_setLoggerClient(
IF_LoggerClient * pLogger)
{
f_mutexLock( gv_hLoggerMutex);
if (gv_pLogger)
{
gv_pLogger->Release();
}
if ((gv_pLogger = pLogger) != NULL)
{
gv_pLogger->AddRef();
}
f_mutexUnlock( gv_hLoggerMutex);
}

View File

@@ -184,6 +184,13 @@ RCODE FLMAPI ftkStartup( void)
setrlimit( RLIMIT_FSIZE, &rlim);
#endif
// Setup logger
if (RC_BAD( rc = f_loggerInit()))
{
goto Exit;
}
Exit:
@@ -224,6 +231,8 @@ void FLMAPI ftkShutdown( void)
{
gv_pXml->Release();
}
f_loggerShutdown();
f_freeRandomGenerator();
f_freeCharMappingTables();

View File

@@ -1512,6 +1512,13 @@
void flmDbgLogExit( void);
void flmDbgLogFlush( void);
/****************************************************************************
Desc: Logger client
****************************************************************************/
RCODE f_loggerInit( void);
void f_loggerShutdown( void);
/****************************************************************************
Desc: Misc.
****************************************************************************/