galaxy-genome-annotation / python-apollo

Python library for talking to Apollo API
MIT License
11 stars 11 forks source link

Implement logging of curl style requests for debugging #10

Closed hexylena closed 6 years ago

hexylena commented 6 years ago

Now all arrow commands have a --log-level flag which allows for logging curl-style requests:

$ arrow -a eu -l info users update_user bot@usegalaxy.eu
INFO:root:curl https://apollo.usegalaxy.eu/apollo_api/user/loadUsers \
  -H 'Content-Type: application/json' \
  -d '{"username": "admin@usegalaxy.eu", "password": "<redacted>", "userId": "bot@usegalaxy.eu"}'
INFO:root:curl https://apollo.usegalaxy.eu/apollo_api/user/updateUser \
  -H 'Content-Type: application/json' \
  -d '{"availableGroups": [], "role": "USER", "password": "<redacted>", "newPassword": "", "userId": 24, "firstName": "Test", "organismPermissions": [], "username": "admin@usegalaxy.eu", "groups": [], "lastName": "User"}'

(Manually redacted passwords, manually broken lines). Nice for submitting bug reports since these reuqests are easier for non-python-apollo users to reproduce.