-
Notifications
You must be signed in to change notification settings - Fork 34
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
dev: Usage of InternalLogger and key values #135
Conversation
4294b2c
to
9efa29d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature will add quite some benefit in debugging SIL Kit systems in the future!
I see two major points that needs some refactoring:
- Condense the logging "keys" to a seperate header which prevents typos and an overview of the available keys.
- Using an
unordered_map
for the storage of key+value seems reasonable for any subsequent analysis, but here it has a disadvantage: When collecting the pairs in theServiceDescriptor::to_keyValues()
and printing to the (stdout or file) log inKeyValuesToJsonString
, we lose control over the order of pairs. E.g. in the Send / Recv logs the NetworkName should be at the beginning for readability. Astd::map
also doesn't help, as we want manual control over the order. Also, from what I see we never need the access by key, so we actually don't need the map. I suggest switching to astd::vector<std::pair<std::string, std::string>>
, so we can define the iteration order via the insertion order.
More minor findings:
- Where used, double check if
ILoggerInternal
is really needed overILogger
. This got a litte bit confusing. Consider renaming toIStructuredLoggerInternal
that it's more clear that this code part uses the structured logging. - Few suggestions for SetMessage() wording
- Cleanup commented out code
6d4e828
to
c94e0fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more things as discussed:
- No escaping in KeyValuesToSimpleString
- MessageBuffer Ser/Des for std::pair instead of std:vector<pair...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now!
…nd sim step start/stop
e89e80c
to
53460c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RpcClient and Server were logging the wrong labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss potential performance issues before merging
improve performance, move for-loops behind logging check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Subject
Usage of the internal logger API and key values.
Description
Selected logmessages are switch to use the new internal Logger API. Values, which bevor where integrated in the message string, are now handled as key values.
Instructions for review / testing
Developer checklist (address before review)