Skip to content
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

Improved logging #292

Merged
merged 5 commits into from
Nov 3, 2024
Merged

Improved logging #292

merged 5 commits into from
Nov 3, 2024

Conversation

sea-bass
Copy link
Owner

@sea-bass sea-bass commented Nov 2, 2024

Better late than never!

I was digging through the logging module and made some nice updates. Now:

  • All print (unless it's an actual print function) and warnings.warn calls have been replaced with actual logging
  • There are 3 types of loggers: A PyRoboSim global logger, a world logger, and per-robot loggers
  • When attaching a ROS node, the world and per-robot loggers change to actual ROS loggers

Closes #88

@sea-bass sea-bass marked this pull request as ready for review November 2, 2024 18:04
@sea-bass sea-bass requested a review from eholum November 2, 2024 18:04
Copy link

github-actions bot commented Nov 2, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
core
   __init__.py90100% 
   dynamics.py49197%142
   gazebo.py137894%55, 128, 234, 248–252
   hallway.py94891%200, 242–245, 269–271
   locations.py1311886%69, 71, 88, 104, 117–118, 120–121, 138, 196, 211, 236, 246, 302–303, 305–306, 335
   objects.py69592%78, 106, 137, 184, 197
   robot.py4808482%268, 271, 283, 286, 290–291, 296–297, 337–339, 355, 372–373, 412–414, 418–422, 447, 450, 454–456, 483, 485, 527–528, 530–531, 537–538, 547–550, 555, 557, 566–568, 575–577, 639–641, 666–668, 674–675, 683–687, 732–734, 745–746, 806–808, 813, 860–862, 867, 885, 891, 894, 896, 898, 901–903, 980, 998, 1001
   room.py48197%113
   world.py82019076%160, 163, 199–200, 204, 278–279, 281, 284, 314–315, 377, 391–392, 394, 397, 412–414, 434–438, 440–442, 444–445, 448, 450–453, 457–461, 464–465, 468, 471–482, 498–499, 517–519, 533, 535, 538–539, 544–546, 565–566, 568–569, 585, 587, 590–591, 596–598, 608–610, 627–628, 630–631, 645, 647, 650–651, 656–658, 681, 683, 686–687, 692–694, 730, 736, 772–773, 776, 799, 819, 822, 833, 836, 844, 860–864, 866, 869–870, 873–876, 878, 881, 884–885, 888–890, 892–894, 896–898, 900, 915, 922, 933–937, 972–973, 977–978, 996–997, 1003–1004, 1006–1007, 1009, 1011–1012, 1014, 1016–1017, 1027–1028, 1031, 1033, 1047, 1049, 1056, 1103, 1134–1135, 1158–1159, 1163–1164, 1183–1184, 1188–1189, 1214–1215, 1268–1269, 1293, 1358, 1365, 1475–1476, 1528, 1608–1609, 1675, 1685
   yaml_utils.py109694%62, 66, 168, 171, 190, 193
gui
   __init__.py20100% 
   action_runners.py914847%32–33, 35–39, 41, 74–75, 77–81, 83, 109–110, 112–116, 118, 144–145, 147–151, 153, 176–177, 179–183, 185, 208–209, 211–215, 217
   main.py2747273%23–25, 46, 90, 94–97, 246–255, 267–276, 279, 286–289, 291, 294–300, 304, 309–310, 314–315, 326, 369–370, 379–380, 384–385, 397, 400–403, 405–406, 409–412, 414–416, 420–423
   world_canvas.py2635280%134–137, 141–142, 147–148, 155, 157, 159, 216–218, 224, 226, 246–248, 293, 350–351, 378–379, 381, 383–384, 386–389, 391–392, 396–402, 405, 408–409, 422, 440–441, 443, 449, 451–454
manipulation
   __init__.py10100% 
   grasping.py2376473%100, 108, 110–112, 114–122, 124, 132, 462, 464–466, 470–472, 566–567, 569–571, 574–578, 586, 589–591, 596–597, 603–607, 610–617, 620–622, 631, 633, 635–641
navigation
   __init__.py11190%37
   a_star.py761185%82–84, 87–89, 91–93, 181, 190
   execution.py94792%81–83, 88–90, 125
   occupancy_grid.py1391489%45–48, 50–54, 57, 193, 227, 235, 239
   prm.py55492%59–60, 139, 148
   rrt.py1600100% 
   visualization.py32681%88–93
   world_graph.py58493%117, 120, 130, 139
planning
   __init__.py00100% 
   actions.py1120100% 
planning/pddlstream
   __init__.py7185%13
   default_mappings.py90100% 
   planner.py40880%119–126
   primitives.py61591%64, 68, 82, 94, 232
   utils.py99891%66, 93, 105, 115–116, 207–208, 211
utils
   __init__.py00100% 
   general.py33487%23, 45, 51–52
   knowledge.py1522086%91, 122, 163–168, 170–171, 174–178, 209–210, 252, 268, 331
   logging.py15193%55
   motion.py70395%93–94, 96
   polygon.py1110100% 
   pose.py890100% 
   search_graph.py93396%239–241
   trajectory.py67297%130, 167
TOTAL439765985% 

Tests Skipped Failures Errors Time
195 0 💤 0 ❌ 0 🔥 3m 25s ⏱️

Copy link
Collaborator

@eholum eholum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooray! Love me some real logging. I did a little playing around with this and it's a nice improvement!

I just have some ideas to consolidate log construction and configuration to a single place, even if you want to have "separate" loggers for different modules... also making the ROS logger globally available...

pyrobosim/examples/demo_pddl.py Outdated Show resolved Hide resolved
pyrobosim/pyrobosim/core/robot.py Outdated Show resolved Hide resolved
pyrobosim/pyrobosim/__init__.py Outdated Show resolved Hide resolved
@sea-bass sea-bass requested a review from eholum November 3, 2024 20:46
Copy link
Collaborator

@eholum eholum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is some high quality centralized logging

@sea-bass sea-bass merged commit 2f40891 into main Nov 3, 2024
7 checks passed
@sea-bass sea-bass deleted the improved-logging branch November 3, 2024 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve logging functionality
2 participants