Sinderella / epherousa

1 stars 0 forks source link

Pick Colours #8

Closed Sinderella closed 7 years ago

ngkogkos commented 7 years ago

How about something like this:

image

I just used bash sequences:

    log.debug("\033[32mThis is a test *debug* message\033[0m")
    log.info("This is a test *info* message")
    log.debug("\033[36mThis is a test *notice* message\033[0m")
    log.warning("\033[33mThis is a test *warning* message\033[0m")
    log.error("\033[91mThis is a test *error* message\033[0m")
    log.critical("\033[31mThis is a test *critical* message\033[0m")

I am not sure if these will work properly in Windows and if we can find a better way to ensure same colors in all OSes. Also, if we can get colors in different sequences somehow we can make some small amendments to make them a bit nicer, for example make the debug lighter and the warning color more orangy.

For now I hardcoded the colors in each invocation, but I am hoping @Sinderella you will have a smooth nice way to configure these on setup?

Lastly, look at this:

image

I think its nice how each line has diff colors, so I think timestamps should always be greeny same with DEBUG as in the screenshot above and some info should be default white color and then we color the log message with colors like the ones above?

PS. Screenshots above taken from

https://coloredlogs.readthedocs.io/en/latest/ http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output

Sinderella commented 7 years ago

We can use this package to handle the cross-platform colours.

https://github.com/tartley/colorama

For the colours, I have no comments as I'm so bad at art. LOL

Sinderella commented 7 years ago

@ngkogkos see b44de67f12342a0e2e0d620df5191d1ea3d0af95