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

DISPATCH-1516 - Modified log statements to include link identifier. A… #645

Closed
wants to merge 2 commits into from

Conversation

ganeshmurthy
Copy link
Contributor

…lso logged delivery outcome

@@ -373,6 +376,8 @@ void qdr_delivery_increment_counters_CT(qdr_core_t *core, qdr_delivery_t *delive
core->modified_deliveries++;
}

qd_log(core->log, QD_LOG_DEBUG, delivery->presettled?"Delivery outcome for pre-settled: dlv:%lx link:%"PRIu64" is %s": "Delivery outcome for: dlv:%lx link:%"PRIu64" is %s", (long) delivery, link->identity, pn_disposition_type_name(outcome));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to read this a couple of times to figure out what's going on.
I'd avoid using a ?: to pick the format argument - that will work but it's.... clever.

Why not use a format string with a %s entry for the part of the output that varies, i.e.:
qd_log(..., ..., "Delivery outcome for%s: dlv:%lx link:<etc, etc, etc> is %s",
(delivery->presettled) ? " pre-settled" : "",
....)

Note the lack of space between "for" and the ":" in the format string and the leading space before "presettled"

@asfgit asfgit closed this in 7819caa Dec 11, 2019
ChugR pushed a commit to ChugR/qpid-dispatch that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants