rbac: add some debug logging.#3744
Conversation
Signed-off-by: Yangmin Zhu <ymzhu@google.com>
Signed-off-by: Yangmin Zhu <ymzhu@google.com>
|
It seems the coverage test is running at debug level which caused the test fail: I changed the test to not to check exactly called times. The better way probably should to increase the expect_times by 1 when in debug mode, but not sure if this is a common way in Envoy. |
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, some small comments.
| auto& expect = EXPECT_CALL(connection_, localAddress()); | ||
| if (times > 0) { | ||
| expect.Times(times); | ||
| if (at_most_times > 0) { |
There was a problem hiding this comment.
This isn't a useful expectation. Please just make this an ON_CALL(...).WillByDefault(...)
| bool) { | ||
| ENVOY_LOG( | ||
| debug, | ||
| "checking request:\n" |
There was a problem hiding this comment.
Debug lines in general should be single line. Please remove the newlines.
| bool) { | ||
| ENVOY_LOG( | ||
| debug, | ||
| "checking request:\n" |
There was a problem hiding this comment.
"checking request" isn't a very descriptive message. Either make a new "rbac" log type, or prefix all of the messages you added with "rbac: " (or something similar).
There was a problem hiding this comment.
Thanks for the suggestion, I added a new "rbac" log type.
Signed-off-by: Yangmin Zhu <ymzhu@google.com>
source/common/common/logger.h
Outdated
| FUNCTION(stats) \ | ||
| FUNCTION(thrift) | ||
| FUNCTION(thrift) \ | ||
| FUNCTION(rbac) |
Signed-off-by: Yangmin Zhu <ymzhu@google.com>
Signed-off-by: Yangmin Zhu ymzhu@google.com
Description: Added some log for help debugging
Risk Level: Low
Testing: n/a
Docs Changes: n/a
Release Notes: n/a
@lizan @mattklein123 @rodaine
Thank you!