Skip to content

Commit

Permalink
FIX improve logDeprecation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Jan 11, 2024
1 parent 04f7ef2 commit 7194d95
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/manuals/admin/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,9 @@ time=2024-01-11T13:57:13.624Z | lvl=WARN | corr=52808938-b089-11ee-9835-080027cd
* Usages of [`"attrsFormat": "legacy"`](../orion-api.md#subscriptionnotification). For instance:

```
time=2024-01-11T16:23:24.646Z | lvl=WARN | corr=be709034-b09d-11ee-b5d1-080027cd35f1 | trans=1704990203-652-00000000012 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=MongoCommonSubscription.cpp[598]:setFormat | msg=Deprecated usage of notification legacy format in subscription creation or modification (subId: 65a015fcda947708d30425eb)
time=2024-01-11T16:23:24.646Z | lvl=WARN | corr=be709034-b09d-11ee-b5d1-080027cd35f1 | trans=1704990203-652-00000000012 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=MongoCommonSubscription.cpp[598]:setFormat | msg=Deprecated usage of notification legacy format in subscription creation (subId: 65a015fcda947708d30425eb)
time=2024-01-11T16:23:24.675Z | lvl=WARN | corr=be74dc98-b09d-11ee-b2d6-080027cd35f1 | trans=1704990203-652-00000000013 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=mongoGetSubscriptions.cpp[217]:setNotification | msg=Deprecated usage of notification legacy format detected in existing subscription (subId: 65a015fcda947708d30425eb)
time=2024-01-11T16:23:24.701Z | lvl=WARN | corr=be709034-b09d-11ee-b5d1-080027cd35f1 | trans=1704990203-652-00000000012 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=MongoCommonSubscription.cpp[598]:setFormat | msg=Deprecated usage of notification legacy format in subscription modification (subId: 65a015fcda947708d30425eb)
time=2024-01-11T16:23:24.716Z | lvl=WARN | corr=be7ae5ac-b09d-11ee-98c8-080027cd35f1 | trans=1704990203-652-00000000015 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=Notifier.cpp[680]:buildSenderParams | msg=Deprecated usage of notification legacy format in notification (subId: 65a015fcda947708d30425eb)
```

Expand Down
2 changes: 1 addition & 1 deletion src/lib/mongoBackend/mongoCreateSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ std::string mongoCreateSubscription

if (logDeprecate && sub.attrsFormat == NGSI_V1_LEGACY)
{
LM_W(("Deprecated usage of notification legacy format in subscription creation or modification (subId: %s)", subId.c_str()));
LM_W(("Deprecated usage of notification legacy format in subscription creation (subId: %s)", subId.c_str()));
}

reqSemGive(__FUNCTION__, "ngsiv2 create subscription request", reqSemTaken);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mongoBackend/mongoUpdateSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ std::string mongoUpdateSubscription

if (logDeprecate && subUp.attrsFormat == NGSI_V1_LEGACY)
{
LM_W(("Deprecated usage of notification legacy format in subscription creation or modification (subId: %s)", subUp.id.c_str()));
LM_W(("Deprecated usage of notification legacy format in subscription modification (subId: %s)", subUp.id.c_str()));
}

// Description is special, as "" value removes the field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,9 @@ Deprecated usage of legacyForwarding mode in update forwarding operation (regId:
Raising alarm ForwardingError localhost:9801/v2/updateContext: forwarding failure for sender-thread: Couldn't connect to server
Raising alarm BadInput 127.0.0.1: The requested entity has not been found. Check type and id
Releasing alarm BadInput 127.0.0.1
Deprecated usage of notification legacy format in subscription creation or modification (subId: SUB_ID)
Deprecated usage of notification legacy format in subscription creation (subId: SUB_ID)
Deprecated usage of notification legacy format detected in existing subscription (subId: SUB_ID)
Deprecated usage of notification legacy format in subscription creation or modification (subId: SUB_ID)
Deprecated usage of notification legacy format in subscription modification (subId: SUB_ID)
Deprecated usage of notification legacy format in notification (subId: SUB_ID)
Raising alarm NotificationError localhost:1234/: notification failure for queue worker: Couldn't connect to server

Expand Down

0 comments on commit 7194d95

Please sign in to comment.