magillus / flutter-fimber

Fimber is Flutter logger inspired by Timber (logger API for Android)
106 stars 22 forks source link

easier way to do colorize wrapping? #60

Closed fredgrott closed 4 years ago

fredgrott commented 4 years ago

okay my head is still asleep...must be turkey I ate?

If I extend the fimber class than I should be able to enable some default app logs with colorize color coding so I do not have to manually add the colorize wrap to every log statement I write.

But its a temporary hack.

Is there a better way to do it?

magillus commented 4 years ago

You should not need to extend Fimber class to do this. Try to add pairs to DebugTree().colorizeMap Map<String,ColorizeStyle> with value of log level as key and color style as value, see DebugTree class.

  1. Create DebugTree() keep reference
  2. change colorizeMap values
  var tree = DebugTree();
  tree.colorizeMap["D"] = ColorizeStyle(
      [AnsiStyle(AnsiSelection.foreground, color: AnsiColor.cyan)]);
magillus commented 4 years ago

Closing issue, let me know if that still is happening and reopen it.