datalad / datalad-xnat

Track XNAT projects with DataLad
Other
3 stars 9 forks source link

ENH: Add a logging info on starting the authentication process #106

Closed adswa closed 2 years ago

adswa commented 2 years ago

My rational to add this is UX-based: When running "datalad xnat-init" it can take a while for the command to finish the query. Without any change to the log level, there is nothing that the user is seeing - the command just sits there and does not return until the query is finished. Notifying the user about the process of authentication is a quick feedback that there indeed is something happening.

Here's a gif before and after the change: ux

adswa commented 2 years ago

~oh wait, but info isn't the default log level, right?~ I don't know where and how the default log level is set, but removing any logging config still results in [INFO] log messages being shown:

(xnat) adina@muninn in /tmp/x on git:master
❱ git config --list | grep level
(xnat) adina@muninn in /tmp/x on git:master
❱ datalad xnat-init https://xnat.kube.fz-juelich.de                         1 !
[INFO   ] Authenticating to https://xnat.kube.fz-juelich.de 
No project name specified. The following projects are available on https://xnat.kube.fz-juelich.de for user a.wagner:
  1000BRAINS
  3T_invivo
[...]
adswa commented 2 years ago

makes sense, thanks

adswa commented 2 years ago

I have switched to log the query for projects instead. Is this better? (I can rebase and force push if its okay, but happy to add other logging elsewhere)