use dynamic debug flag for logClient

This commit is contained in:
2019-09-17 17:06:55 +02:00
committed by Martin Konrad
parent feb1f9b0df
commit 059c385286
2 changed files with 14 additions and 11 deletions

View File

@@ -25,3 +25,6 @@ variable(callbackParallelThreadsDefault,int)
# Real-time operation
variable(dbThreadRealtimeLock,int)
# show logClient network activity
variable(logClientDebug,int)

View File

@@ -21,7 +21,6 @@
#include <string.h>
#include <stdio.h>
#define epicsExportSharedSymbols
#include "dbDefs.h"
#include "epicsEvent.h"
#include "iocLog.h"
@@ -32,9 +31,13 @@
#include "epicsAssert.h"
#include "epicsExit.h"
#include "epicsSignal.h"
#include "epicsExport.h"
#include "logClient.h"
int logClientDebug = 0;
epicsExportAddress (int, logClientDebug);
typedef struct {
char msgBuf[0x4000];
struct sockaddr_in addr;
@@ -65,10 +68,10 @@ static char* logClientPrefix = NULL;
*/
static void logClientClose ( logClient *pClient )
{
# ifdef DEBUG
if (logClientDebug) {
fprintf (stderr, "log client: lingering for connection close...");
fflush (stderr);
# endif
}
/*
* mutex on
@@ -90,9 +93,8 @@ static void logClientClose ( logClient *pClient )
*/
epicsMutexUnlock (pClient->mutex);
# ifdef DEBUG
if (logClientDebug)
fprintf (stderr, "done\n");
# endif
}
/*
@@ -262,10 +264,10 @@ void epicsShareAPI logClientFlush ( logClientId id )
*/
static void logClientMakeSock (logClient *pClient)
{
# ifdef DEBUG
if (logClientDebug) {
fprintf (stderr, "log client: creating socket...");
# endif
fflush (stderr);
}
epicsMutexMustLock (pClient->mutex);
@@ -283,10 +285,8 @@ static void logClientMakeSock (logClient *pClient)
epicsMutexUnlock (pClient->mutex);
# ifdef DEBUG
if (logClientDebug)
fprintf (stderr, "done\n");
# endif
}
/*