SourceHorizon / logger

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

Include date when `PrettyPrinter(printTime: true)` #80

Closed andrei-toterman closed 1 month ago

andrei-toterman commented 1 month ago

PrettyPrinter only prints the time of a log event, but not the date, and I think it would be very useful to get that information. Perhaps it could be even more configurable by adding a printDate parameter, so things remain backwards compatible.

Bungeefan commented 1 month ago

Hi, good idea!

I tried to create a customizable but still backwards-compatible API for a custom DateTime format. Could you please check out the date_time_format branch and let me know if this would fulfill your use-case? (feel free to provide other feedback as well)

You should be able to just add this to your pubspec.yaml:

dependency_overrides:
  logger:
    git:
      url: https://github.com/SourceHorizon/logger
      ref: date_time_format
andrei-toterman commented 1 month ago

Hey! Yes, I think that is a pretty cool feature. It's nice that you have the power to format it however you like but you also get some defaults to choose from. Thanks!

Bungeefan commented 1 month ago

Thanks for the nice feedback, that's exactly what I was aiming for. Since this isn't yet in the main branch, I would like to keep the issue open until it is merged.