Skip to content

Commit

Permalink
fix usage of logger before it is initialized (fix ros#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Aug 17, 2014
1 parent 6a6bdac commit 4fb40f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tools/roslaunch/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog for package roslaunch
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* fix usage of logger before it is initialized (`#490 <https://github.com/ros/ros_comm/issues/490>`_) (regression from 1.11.6)

1.11.8 (2014-08-04)
-------------------
* remove implicit rostest dependency and use rosunit instead (`#475 <https://github.com/ros/ros_comm/issues/475>`_)
Expand Down
7 changes: 5 additions & 2 deletions tools/roslaunch/src/roslaunch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def _validate_args(parser, options, args):

def main(argv=sys.argv):
options = None
logger = None
try:
from . import rlutil
parser = _get_optparse()
Expand Down Expand Up @@ -305,13 +306,15 @@ def main(argv=sys.argv):
except RLException as e:
roslaunch_core.printerrlog(str(e))
roslaunch_core.printerrlog('The traceback for the exception was written to the log file')
logger.error(traceback.format_exc())
if logger:
logger.error(traceback.format_exc())
sys.exit(1)
except ValueError as e:
# TODO: need to trap better than this high-level trap
roslaunch_core.printerrlog(str(e))
roslaunch_core.printerrlog('The traceback for the exception was written to the log file')
logger.error(traceback.format_exc())
if logger:
logger.error(traceback.format_exc())
sys.exit(1)
except Exception as e:
traceback.print_exc()
Expand Down

0 comments on commit 4fb40f8

Please sign in to comment.