This repository was archived by the owner on May 31, 2025. It is now read-only.
add --set-master-logger-level option for 'rosmaster' to output LOG_API#1180
Merged
dirk-thomas merged 10 commits intoros:lunar-develfrom Oct 17, 2017
Merged
add --set-master-logger-level option for 'rosmaster' to output LOG_API#1180dirk-thomas merged 10 commits intoros:lunar-develfrom
dirk-thomas merged 10 commits intoros:lunar-develfrom
Conversation
dirk-thomas
reviewed
Oct 6, 2017
tools/roslaunch/scripts/roscore
Outdated
| parser.add_option("-t", "--timeout", | ||
| dest="timeout", | ||
| help="override the socket connection timeout (in seconds).", metavar="TIMEOUT") | ||
| parser.add_option("--set-master-logger-level", |
Member
There was a problem hiding this comment.
The set of the options seems redundant to me. How about just --master-logger-level?
|
|
||
| if options.master_logger_level: | ||
| level = {'debug': logging.DEBUG, 'info': logging.INFO, 'warn': logging.WARN, 'error': logging.ERROR, 'fatal': logging.FATAL} | ||
| if options.master_logger_level in level.keys(): |
Member
There was a problem hiding this comment.
Should we ignore the case and do options.master_logger_level.lower() here?
| socket.setdefaulttimeout(float(options.timeout)) | ||
|
|
||
| if options.master_logger_level: | ||
| level = {'debug': logging.DEBUG, 'info': logging.INFO, 'warn': logging.WARN, 'error': logging.ERROR, 'fatal': logging.FATAL} |
Member
There was a problem hiding this comment.
Since the dict contains multiple elements I would suggest naming the variable levels.
| logger.info("set rosmaster.master logger level '{}'".format(options.master_logger_level)) | ||
| logging.getLogger("rosmaster.master").setLevel(level[options.master_logger_level]) | ||
| else: | ||
| logger.error("--set-master-logger-level received unkonwn option '{}'".format(options.master_logger_level)) |
Contributor
Author
|
@dirk-thomas , thanks for comments. updated PR. |
dirk-thomas
reviewed
Oct 9, 2017
| if type_ in [Master.ROSMASTER, Master.ZENMASTER]: | ||
| package = 'rosmaster' | ||
| args = [master, '--core', '-p', str(port), '-w', str(num_workers)] | ||
| args = [master, '--core', '-p', str(port), '-w', str(num_workers), '--master-logger-level', str(master_logger_level)] |
Member
There was a problem hiding this comment.
Does this potentially pass False?
Contributor
Author
There was a problem hiding this comment.
correct, will not pass argument when master_logger_level is False
| if self.server is None: | ||
| raise RLException("server is not initialized") | ||
| self.runner = roslaunch.launch.ROSLaunchRunner(self.run_id, self.config, server_uri=self.server.uri, pmon=self.pm, is_core=self.is_core, remote_runner=self.remote_runner, is_rostest=self.is_rostest, num_workers=self.num_workers, timeout=self.timeout) | ||
| self.runner = roslaunch.launch.ROSLaunchRunner(self.run_id, self.config, server_uri=self.server.uri, pmon=self.pm, is_core=self.is_core, remote_runner=self.remote_runner, is_rostest=self.is_rostest, num_workers=self.num_workers, timeout=self.timeout,master_logger_level=self.master_logger_level) |
Contributor
Author
There was a problem hiding this comment.
fixed in new commit
Member
|
Thank you very much for the patch and iterating on it. |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
extended version of #1173
will output LOG_API messages