ehrapy icon indicating copy to clipboard operation
ehrapy copied to clipboard

Consider looking through logging messages

Open namsaraeva opened this issue 1 year ago • 4 comments

Description of feature

I noticed that many messages produced by the logger are extremely long and take too much space when analyzing something in a Jupyter notebook. It really reduced positive user experience for me.

  • When encoding, the ep.pp.encode(autodetect=True) function prints autodetected categorical columns in a column which makes the page ... way too long.
  • Moving to obs / X also produces way too long output sometimes.
  • Some messages are not clear enough to my taste.

namsaraeva avatar Nov 15 '23 16:11 namsaraeva

Fully agreed. Let's make this shorter. Ideally also controlled by log levels

Zethson avatar Nov 15 '23 17:11 Zethson

@Lilly-May

  • [ ] Get rid of the colors. Always use the default color by not selecting one at all.
  • [ ] Use emoticons for warning, info, and other levels. Try to find a couple of reasonable small icons that are useful for that. Ask @Zethson for feedback.
  • [ ] Replace print messages with relevant logging messages.
  • [ ] Polish logging messages after talking to @Zethson

Zethson avatar Dec 20 '23 15:12 Zethson

We have the following six logging types:

  • Critical (I did not find any usages)
  • Error (I did not find any usages)
  • Warning (used 2 times)
  • Info (used 16 times)
  • Debug (used 32 times)
  • Hint (I did not find any usages)

Things to decide:

  1. Do we want to keep the unused categories (especially HINT, since that was additionally added)? Or are they used somewhere and I'm simply not aware?
  2. ERROR and CRITICAL are printed as red (blinking) - should I also delete the coloring for those two types? Personally, I would expect an error to be printed in red.
  3. I suggest the following icons and would appreciate feedback on whether they are intuitive:
    • Debug: 🪲 (or 🔧)
    • Info: 💭
    • Warning: ❗️
    • Error: ❌
    • Critical: 🚨
    • Hint: 💡
  4. Below is an example of how the logging messages currently look. Do we want to keep the date and time (or maybe just the time)? Do we want to keep the logpath (root here)? Bildschirmfoto 2024-01-03 um 12 58 23

Lilly-May avatar Jan 03 '24 12:01 Lilly-May

Things to decide:

1. Do we want to keep the unused categories (especially _HINT_, since that was additionally added)? Or are they used somewhere and I'm simply not aware?

I don't think that they're used, but we could make better use of HINT in rare cases. Generally, I don't want to spam users with logging messages, but why not?

2. _ERROR_ and _CRITICAL_ are printed as red (blinking) - should I also delete the coloring for those two types? Personally, I would expect an error to be printed in red.

Error is a tricky one because in almost all cases you want to raise an exception and not print an error logging messages. We can keep the red here but I don't know when we'd really use them.

3. I suggest the following icons and would appreciate feedback on whether they are intuitive:
   
   * Debug: 🪲 (or 🔧)
   * Info: 💭
   * Warning: ❗️
   * Error: ❌
   * Critical: 🚨
   * Hint: 💡

Not sure whether I like the cloud for info... This is what Lamin uses: https://github.com/laminlabs/lamin-utils/blob/368016a7e0ca84ff653a3b25c058c5eba2fb1670/lamin_utils/_logger.py#L68 and I think that one reasoning was to reduce the number of icons to not confuse users. But let's start with the cloud and we can reconsider it later!

4. Below is an example of how the logging messages currently look. Do we want to keep the date and time (or maybe just the time)? Do we want to keep the logpath (_root_ here)?

I don't think that we need the name of the logger aka the logpath. I actually also don't think that we need time & date. If people were using it in more pipeliny settings yeah, but probably not...

Zethson avatar Jan 04 '24 15:01 Zethson