SAP / project-kb

Home page of project "KB"
https://sap.github.io/project-kb/
Apache License 2.0
113 stars 73 forks source link

Create a central function to produce user-friendly output (distinctinct from diagnostic logs) #296

Closed copernico closed 2 years ago

copernico commented 2 years ago

Example:

Downloading repo...           [OK]
Fetching commits from backend [WARN]
  Backend not reachable
Preprocessing commits....     [FAIL]
Aborting
copernico commented 2 years ago

First cut in 1f6c0dcbb1c09456071eb35410f51997b35f652c

image

@geryxyz my code is quite crude, consider it an executable description of what I expect it to do (the "how" can definitely be improved). Could you please check if I did something wrong, particularly in the logging module?

I am also considering writing this console messaging thing as a context manager, so that we can show a message at the begining of a long running operation and then the [OK] or [!!] symbols after the operation completes. Just thinking...

geryxyz commented 2 years ago

@copernico, sure, I began to work on it right now. To minimize conflict, please let me finish my work before you make any other changes.

copernico commented 2 years ago

Good. You might want to take a look at rich, it probably offers all we need (and much more, so let's be cautious not to get carried away with eye candy ;-) )

In action here: https://www.youtube.com/watch?v=4zbehnz-8QU

geryxyz commented 2 years ago

I will check it. It is always good to learn something new, but I have already implemented a solution. https://github.com/SAP/project-kb/pull/298 I used the Colorama package.