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

Please add "success" in green. #12

Closed mukhtorov712 closed 1 year ago

mukhtorov712 commented 1 year ago

I monitor requests and responses using a logger. In this case, I would like to use a green log for a successful request.

Bungeefan commented 1 year ago

I am guessing you are talking about the PrettyPrinter.

How would you indicate/label such a successful request? Currently, colors are only dependent on the log level you are using.

Bungeefan commented 1 year ago

Without additional information, I am unfortunately not able to resolve this issue. I am therefore going to close this issue.

mukhtorov712 commented 1 year ago

I organized the processes of sending and receiving requests. I will show in the log that the received response was successful. I am currently using this log "Logger().i(response)" -> "blue". I want to use something like "Logger().s(response)" -> "green". I did this by modifying the library, but I want it to be useful for others. Thank you.

Bungeefan commented 1 year ago

What is your s log level, and would it be sufficient to enable the configuration of the levelColors in PrettyPrinter?

You could also post your modification, so I can get a better understanding of your desired solution.

Bungeefan commented 1 year ago

Following up the #37 PR:

Unfortunately, I had to decline the proposed solution, because I don't think that a custom log level specific to your use case justifies adding it to the logger package. I think you can still achieve a similar solution without introducing a new uncommon log level.

The addition would also lead to other considerations:

I hope you understand my concerns, and I am still open for further discussion and new ideas!