ome / omero-cli-zarr

https://pypi.org/project/omero-cli-zarr/
GNU General Public License v2.0
15 stars 10 forks source link

Replace print statements with logging #138

Open joshmoore opened 1 year ago

joshmoore commented 1 year ago
          I tried the example at https://docs.python.org/3/howto/logging.html#changing-the-format-of-displayed-messages

adding this at the top of cli.py

import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
logging.debug('This message should appear on the console')
logging.info('So should this')
logging.warning('And this, too')

but that only printed:

WARNING:root:And this, too

So it looks like something else is calling logging.basicConfig before me, so that my call above is then ignored?

Agreed that we could look to remove print statements in a different PR, since this one is already quite long, and print is used elsewhere already.

_Originally posted by @will-moore in https://github.com/ome/omero-cli-zarr/pull/134#discussion_r1131128468_