-
Notifications
You must be signed in to change notification settings - Fork 45
Dev logger topics #310
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
Open
VLukasBecker
wants to merge
23
commits into
main
Choose a base branch
from
dev_logger_topics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev logger topics #310
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1b8d3a0
test topics
VLukasBecker f2f0cc6
Add topics in log message
VLukasBecker e4fe2ad
fixup! Add topics in log message
VLukasBecker 2ee3a48
fixup! Add topics in log message
VLukasBecker 7e7ee9d
Roll out the new internal logger interface
VLukasBecker 289d66b
7e7ee9d35eacfc17c6e5be8b2018f52fdf3d138f
VLukasBecker 29f3bf6
fixup! Roll out the new internal logger interface
VLukasBecker a0d24d7
Upgrade logging in asio component
VLukasBecker 0ff32f4
fixup! Upgrade logging in asio component
VLukasBecker f51e979
Roll out the new internal logger interface
VLukasBecker 651a051
Roll out new logger interface in network controller
VLukasBecker dfaadd8
Roll out new logger interface in tracing component
VLukasBecker 34540c1
fixup! fixup! Upgrade logging in asio component
VLukasBecker 51f0bb8
fixup! fixup! Upgrade logging in asio component
VLukasBecker e339ca2
fixup! fixup! Upgrade logging in asio component
VLukasBecker 39d9a9d
Roll out new logger interface in dashboard component
VLukasBecker f4e3bc9
Roll out new logger interface in metrics component
VLukasBecker af977a1
Roll out new logger interface in network simulator component
VLukasBecker 9c46c60
Cleaning and missing roll out
VLukasBecker eaa18ac
Cleanups and fixes
VLukasBecker 04816b6
Fix, update missing logger calls
VLukasBecker fb1baa7
Fix, clean public logger interface
VLukasBecker 6a0d2ef
Fix review requests
VLukasBecker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,11 @@ inline std::string to_string(const Level& level); | |
| inline Level from_string(const std::string& levelStr); | ||
| inline std::ostream& operator<<(std::ostream& out, const Level& level); | ||
|
|
||
| // ================================================================================ | ||
| inline std::string to_string(const Topic& topic); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The string-conversions should also be moved to the internal code. |
||
| inline Topic from_topic_string(const std::string& topicStr); | ||
| inline std::ostream& operator<<(std::ostream& out, const Topic& topic); | ||
| //inline bool operator== (const Topic& lhs, const Topic& rhs); | ||
| // ================================================================================ | ||
| // Inline Implementations | ||
| // ================================================================================ | ||
|
|
||
|
|
@@ -84,6 +88,120 @@ inline Level from_string(const std::string& levelStr) | |
| return Level::Off; | ||
| } | ||
|
|
||
|
|
||
| std::string to_string(const Topic& topic) | ||
| { | ||
| std::stringstream outStream; | ||
| outStream << topic; | ||
| return outStream.str(); | ||
| } | ||
|
|
||
| std::ostream& operator<<(std::ostream& outStream, const Topic& topic) | ||
| { | ||
| switch (topic) | ||
| { | ||
| case Topic::User: | ||
| outStream << "User"; | ||
| break; | ||
| case Topic::TimeSync: | ||
| outStream << "TimeSync"; | ||
| break; | ||
| case Topic::LifeCycle: | ||
| outStream << "LifeCycle"; | ||
| break; | ||
| case Topic::SystemState: | ||
| outStream << "SystemState"; | ||
| break; | ||
| case Topic::MessageTracing: | ||
| outStream << "MessageTracing"; | ||
| break; | ||
| case Topic::ServiceDiscovery: | ||
| outStream << "ServiceDiscovery"; | ||
| break; | ||
| case Topic::Participant: | ||
| outStream << "Participant"; | ||
| break; | ||
| case Topic::Asio: | ||
| outStream << "Asio"; | ||
| break; | ||
| case Topic::TimeConfig: | ||
| outStream << "TimeConfig"; | ||
| break; | ||
| case Topic::RequestReply: | ||
| outStream << "RequestReply"; | ||
| break; | ||
| case Topic::SystemMonitor: | ||
| outStream << "SystemMonitor"; | ||
| break; | ||
| case Topic::Controller: | ||
| outStream << "Controller"; | ||
| break; | ||
| case Topic::Tracing: | ||
| outStream << "Tracing"; | ||
| break; | ||
| case Topic::Metrics: | ||
| outStream << "Metrics"; | ||
| break; | ||
| case Topic::Dashboard: | ||
| outStream << "Dashboard"; | ||
| break; | ||
| case Topic::NetSim: | ||
| outStream << "NetSim"; | ||
| break; | ||
| case Topic::None: | ||
| outStream << "None"; | ||
| break; | ||
| default: | ||
| outStream << "Invalid"; | ||
| } | ||
| return outStream; | ||
| } | ||
|
|
||
| inline Topic from_topic_string(const std::string& topicStr) | ||
| { | ||
| auto topic = SilKit::Util::LowerCase(topicStr); | ||
| if (topic == "none") | ||
| return Topic::None; | ||
| if (topic == "user") | ||
| return Topic::User; | ||
| if (topic == "timesync") | ||
| return Topic::TimeSync; | ||
| if (topic == "lifecycle") | ||
| return Topic::LifeCycle; | ||
| if (topic == "systemstate") | ||
| return Topic::SystemState; | ||
| if (topic == "messagetracing") | ||
| return Topic::MessageTracing; | ||
| if (topic == "servicediscovery") | ||
| return Topic::ServiceDiscovery; | ||
| if (topic == "participant") | ||
| return Topic::Participant; | ||
| if (topic == "timeconfig") | ||
| return Topic::TimeConfig; | ||
| if (topic == "asio") | ||
| return Topic::Asio; | ||
| if (topic == "requestreply") | ||
| return Topic::RequestReply; | ||
| if (topic == "systemmonitor") | ||
| return Topic::SystemMonitor; | ||
| if (topic == "controller") | ||
| return Topic::Controller; | ||
| if (topic == "tracing") | ||
| return Topic::Tracing; | ||
| if (topic == "metrics") | ||
| return Topic::Metrics; | ||
| if (topic == "netsim") | ||
| return Topic::NetSim; | ||
| if (topic == "dashboard") | ||
| return Topic::Dashboard; | ||
| return Topic::Invalid; | ||
| } | ||
| /* | ||
| inline bool operator==(const Topic& lhs, const Topic& rhs) | ||
| { | ||
| return static_cast<int>(lhs) == static_cast<int>(rhs); | ||
| }*/ | ||
|
|
||
| } // namespace Logging | ||
| } // namespace Services | ||
| } // namespace SilKit | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
enumshould also be moved to the internal code.