Skip to content

Commit

Permalink
Merge pull request #4393 from tzzed/develop
Browse files Browse the repository at this point in the history
Improve log trace
  • Loading branch information
fgalan authored Aug 22, 2023
2 parents ffff911 + ea3e728 commit 5b37215
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Add: servicePath field to builtin attributes (#2877)
- Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated)
- Fix: improve error traces (#4387)
4 changes: 2 additions & 2 deletions src/lib/mongoBackend/MongoCommonUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static bool attrValueChanges(const orion::BSONObj& attr, ContextAttribute* caP,
return caP->valueType != orion::ValueTypeNull;

default:
LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type()));
LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str()));
return false;
}
}
Expand Down Expand Up @@ -442,7 +442,7 @@ static ChangeType mergeAttrInfo
break;

default:
LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type()));
LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str()));
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/ngsi/ContextAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void ContextAttribute::bsonAppendAttrValue
break;

default:
LM_E(("Runtime Error (unknown attribute type: %d)", valueType));
LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str()));
}
}

Expand Down Expand Up @@ -217,7 +217,7 @@ bool ContextAttribute::calculateOperator
return false;

default:
LM_E(("Runtime Error (unknown attribute type: %d)", valueType));
LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str()));
return false;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ bool ContextAttribute::calculateOperator
return false;

default:
LM_E(("Runtime Error (unknown attribute type: %d)", valueType));
LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str()));
return false;
}
}
Expand All @@ -258,7 +258,7 @@ bool ContextAttribute::calculateOperator
}
else
{
LM_E(("Runtime Error (uknown operator: %s)", op.c_str()));
LM_E(("Runtime Error (unknown operator: %s)", op.c_str()));
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/ngsi/ContextAttributeVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void ContextAttributeVector::fill
break;

default:
LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type()));
LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), ca.name.c_str()));
}
}

Expand Down Expand Up @@ -669,7 +669,7 @@ void ContextAttributeVector::applyUpdateOperators(void)
break;

default:
LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType));
LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str()));
}

// Replace old compound value (with $push) with the new one ([])
Expand Down Expand Up @@ -705,7 +705,7 @@ void ContextAttributeVector::applyUpdateOperators(void)
break;

default:
LM_E(("Runtime Error (unknown attribute type: %d)", upOp->valueType));
LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str()));
}

// Replace old compound value (with $push) with the new one ([])
Expand All @@ -726,7 +726,7 @@ void ContextAttributeVector::applyUpdateOperators(void)
}
else
{
LM_E(("Runtime Error (uknown operator: %s", op.c_str()));
LM_E(("Runtime Error (unknown operator: %s", op.c_str()));
}
}
}
Expand Down

0 comments on commit 5b37215

Please sign in to comment.