SourceHorizon / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
197 stars 33 forks source link

[PrettyPrinter] Error Color: Force foreground color to white #9

Closed Bungeefan closed 1 year ago

Bungeefan commented 1 year ago

I am creating this issue to pick up this pull request: https://github.com/simc/logger/pull/137

Summary

PrettyPrinter: Force the foreground color always to white for the red and pink background color.

Status

Currently, foreground color isn't set therefore, the terminal will use the default foreground color to write on the error/wtf background, whichever that it.

Discussion

As far as I am aware, both VSC and Android Studio uses a good contrast color for the foreground, which should provide a good readability when writing on the terminal default background (which we are not when printing the error message). Therefore, forcing no foreground color can result in a worse readability, depending on the theme settings of the terminal and so on.

Please share your opinions and ideas on this topic!

My opinion

I did never experience great readability with a bright red background, yes some colors and combinations are better, but it's just not really enjoyable trying to read the error message. I see no point in painting the error with a bright red background when everything else in the log is already screaming for attention.

I would remove the additional background color of the error as a whole and treat it the same way as the other text in the error log.

DJTB commented 1 year ago

Anything would be better than the current blue on red. Removing the additional background color seems sensible and consistent to me 👍

Bungeefan commented 1 year ago

I just want to mention that only VSC seems to be using blue as foreground color, independent of the current theme. Android Studio on the other hand seems to be using white on dark background and black on light background.

However, neither of these choices are great when used with a red background in terms of visibility and accessibility.

shirne commented 1 year ago

remove the background of error is a good idea.