openneuro-py icon indicating copy to clipboard operation
openneuro-py copied to clipboard

Use Python logging system for emitting log messages when running via the Python API

Open hoechenberger opened this issue 2 years ago • 14 comments

Fixes #141

Adds a cli_only kwarg to emit some log messages only when running from the CLI.

hoechenberger avatar Apr 13 '24 11:04 hoechenberger

@cbrnr Care to test if this works? I don't think the logger honors existing tqdm output, but maybe this is not a problem – I haven't tested it yet

hoechenberger avatar Apr 13 '24 11:04 hoechenberger

Oh, it seems I've created a nice circular import :(

hoechenberger avatar Apr 13 '24 11:04 hoechenberger

Import problem should be fixed now but I don't get log messages. @cbrnr feel free to investigate, I'm a bit busy for the next week or so

hoechenberger avatar Apr 13 '24 11:04 hoechenberger

Screenshot 2024-04-14 at 14 47 52

Problems:

  • [ ] Repeated messages regarding using the token
  • [ ] Token isn't even needed for this dataset
  • [ ] HTTP status codes

hoechenberger avatar Apr 14 '24 12:04 hoechenberger

The token messages also appear on main? Or are they directly caused by changes in this PR?

cbrnr avatar Apr 15 '24 05:04 cbrnr

The token messages also appear on main? Or are they directly caused by changes in this PR?

I don't know. I would believe it also appears in main.

hoechenberger avatar Apr 15 '24 09:04 hoechenberger

OK, so the problems you listed (at least the first two) are not related to this PR and should probably fixed in another PR.

cbrnr avatar Apr 15 '24 09:04 cbrnr

I believe so. Any help in verifying and tracking this would be appreciated!

hoechenberger avatar Apr 15 '24 09:04 hoechenberger

Nice! Once we have a changelog message, we can merge

hoechenberger avatar Sep 30 '24 19:09 hoechenberger