Skip to content

Commit

Permalink
Removed some traces - preparation for release
Browse files Browse the repository at this point in the history
  • Loading branch information
kzangeli committed Dec 28, 2023
1 parent 5047b67 commit be15b00
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
5 changes: 4 additions & 1 deletion src/lib/orionld/kjTree/kjTreeLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C"
#include "kjson/kjRenderSize.h" // kjFastRenderSize
}

#include "logMsg/logMsg.h" // lmOut
#include "logMsg/logMsg.h" // lmTraceIsSet, lmOut

#include "orionld/common/orionldState.h" // orionldState
#include "orionld/common/fileName.h" // fileName
Expand All @@ -46,6 +46,9 @@ extern "C"
//
void kjTreeLogFunction(KjNode* tree, const char* msg, const char* path, int lineNo, const char* functionName, int traceLevel)
{
if (lmTraceIsSet(traceLevel) == false)
return;

char* fileNameOnly = fileName(path);

if (tree == NULL)
Expand Down
39 changes: 20 additions & 19 deletions src/lib/orionld/notifications/orionldAlterationsTreat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C"
#include "kjson/kjRender.h" // kjFastRender
}

#include "logMsg/logMsg.h" // LM_*
#include "logMsg/logMsg.h" // LM_*, lmTraceIsSet

#include "cache/CachedSubscription.h" // CachedSubscription

Expand Down Expand Up @@ -466,30 +466,31 @@ static NotificationPending* notificationLookupByCurlHandle(NotificationPending*
//
void orionldAlterationsTreat(OrionldAlteration* altList)
{
#if 1
// <DEBUG>
int alterations = 0;
for (OrionldAlteration* aP = altList; aP != NULL; aP = aP->next)
if (lmTraceIsSet(LmtAlt))
{
LM_T(LmtAlt, (" Alteration %d:", alterations));
LM_T(LmtAlt, (" Entity In: %p", aP->inEntityP));
LM_T(LmtAlt, (" CompleteEntity: %p", aP->finalApiEntityP));
LM_T(LmtAlt, (" Entity Id: %s", aP->entityId));
LM_T(LmtAlt, (" Entity Type: %s", aP->entityType));
LM_T(LmtAlt, (" Attributes: %d", aP->alteredAttributes));

for (int ix = 0; ix < aP->alteredAttributes; ix++)
int alterations = 0;
for (OrionldAlteration* aP = altList; aP != NULL; aP = aP->next)
{
LM_T(LmtAlt, (" Attribute %s", aP->alteredAttributeV[ix].attrName));
LM_T(LmtAlt, (" Alteration Type: %s", orionldAlterationType(aP->alteredAttributeV[ix].alterationType)));
}
LM_T(LmtAlt, (" Alteration %d:", alterations));
LM_T(LmtAlt, (" Entity In: %p", aP->inEntityP));
LM_T(LmtAlt, (" CompleteEntity: %p", aP->finalApiEntityP));
LM_T(LmtAlt, (" Entity Id: %s", aP->entityId));
LM_T(LmtAlt, (" Entity Type: %s", aP->entityType));
LM_T(LmtAlt, (" Attributes: %d", aP->alteredAttributes));

for (int ix = 0; ix < aP->alteredAttributes; ix++)
{
LM_T(LmtAlt, (" Attribute %s", aP->alteredAttributeV[ix].attrName));
LM_T(LmtAlt, (" Alteration Type: %s", orionldAlterationType(aP->alteredAttributeV[ix].alterationType)));
}

kjTreeLog(aP->inEntityP, "ALT: inEntityP", LmtAlt); // outdeffed
++alterations;
// kjTreeLog(aP->inEntityP, "ALT: inEntityP", LmtAlt); // outdeffed
++alterations;
}
LM_T(LmtAlt, (" %d Alterations present", alterations));
}
LM_T(LmtAlt, (" %d Alterations present", alterations));
// </DEBUG>
#endif

OrionldAlterationMatch* matchList;
int matches;
Expand Down
8 changes: 1 addition & 7 deletions src/lib/orionld/regCache/regCacheCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C"

#include "logMsg/logMsg.h" // LM_*

#include "orionld/common/orionldState.h" // orionldState, kjTreeLog
#include "orionld/common/orionldState.h" // orionldState
#include "orionld/types/OrionldTenant.h" // OrionldTenant
#include "orionld/mongoc/mongocRegistrationsIter.h" // mongocRegistrationsIter
#include "orionld/dbModel/dbModelToApiRegistration.h" // dbModelToApiRegistration
Expand All @@ -48,16 +48,12 @@ extern void apiModelToCacheRegistration(KjNode* apiRegistrationP);
//
int regIterFunc(RegCache* rcP, KjNode* dbRegP)
{
LM_T(LmtRegMatch, ("In regIterFunc"));
kjTreeLog(dbRegP, "dbRegP", LmtRegMatch);

// Convert DB Reg to API Reg
if (dbModelToApiRegistration(dbRegP, true, true) == false)
{
LM_E(("dbModelToApiRegistration failed"));
return 1;
}
kjTreeLog(dbRegP, "apiReg", LmtRegMatch);

// The DB Registration 'dbRegP' is now in API Registration format (after calling dbModelToApiRegistration)
KjNode* apiRegP = dbRegP;
Expand All @@ -77,8 +73,6 @@ int regIterFunc(RegCache* rcP, KjNode* dbRegP)
// Convert API Reg to Cache Reg
apiModelToCacheRegistration(apiRegP);

// kjTreeLog(apiRegP, "Cache Reg", LmtRegCache);

// Insert cacheRegP in tenantP->regCache (rcP)
regCacheItemAdd(rcP, regId, apiRegP, true, fwdContextP);

Expand Down
2 changes: 0 additions & 2 deletions src/lib/orionld/serviceRoutines/orionldDeleteSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ bool orionldDeleteSubscription(void)
// FIXME: If mqtt, we need to disconnect from MQTT broker
// BUT, not until Orion-LD is able to run without sub-cache
//
// kjTreeLog(subP, "MQTT Subscription?");
//
}
else
{
Expand Down

0 comments on commit be15b00

Please sign in to comment.