Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log trace #4393

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- 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
Loading