Frezyx / talker

☎️ Advanced error handler and logger for dart and flutter apps
https://pub.dev/packages/talker
MIT License
486 stars 57 forks source link

custom date/time and header format #170

Closed 2x2xplz closed 7 months ago

2x2xplz commented 9 months ago

Perhaps I'm missing something, but there does not appear to be an easy way to customize the date/time format of the log entries or the metadata header. For example, instead of [WARNING] | 20:38:08 851ms | this is my log message the developer might prefer [WARN 2023-12-13 20:38:08.851] this is my log message

From what I can tell, to make this change one would have to override or add new methods to TalkerDateTimeFormatter then either override TalkerDataInterface.displayTitleWithTime or create a custom TalkerDataInterface, and then somewhere, replace the default versions with your custom/overridden versions of these classes.

Describe the solution you'd like to be able to define the metadata header format as easily as creating and using a custom LoggerFormatter

Describe alternatives you've considered I'm aware you can create an entirely custom log type, however this prevents you from using the default talker.info, talker.debug, etc and you're stuck with talker.logTyped(YourCustomLog('Something like your own service message'));

Additional context There is a lot to like about talker and the ecosystem you've built but given all the possible customization options, it feels strange to not be able to re-define the metadata header format.