Skip to content

Commit b0d9478

Browse files
tkutcherhaarts
authored andcommitted
Update README for colored logs IDE workaround with PrefixPrinter
1 parent b123cf1 commit b0d9478

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var logger = Logger(
8686
printEmojis: true, // Print an emoji for each log message
8787
printTime: false // Should each log print contain a timestamp
8888
),
89-
)
89+
);
9090
```
9191

9292
### Auto detecting
@@ -139,6 +139,17 @@ Please note that all IDEs (VSCode, XCode, Android Studio, IntelliJ) do not
139139
support ANSI escape sequences in their terminal outputs. These escape sequences
140140
are used to color output. If using such an IDE do not configure colored output.
141141

142+
However, if you are using a JetBrains IDE (Android Studio, IntelliJ, etc.)
143+
you can make use of the [Grep Console Plugin](https://plugins.jetbrains.com/plugin/7125-grep-console)
144+
and the [`PrefixPrinter`](/lib/src/printers/prefix_printer.dart)
145+
decorator to achieved colored logs for any logger:
146+
147+
```dart
148+
var logger = Logger(
149+
printer: PrefixPrinter(PrettyPrinter(colors: false))
150+
);
151+
```
152+
142153
## LogOutput
143154

144155
`LogOutput` sends the log lines to the desired destination.<br>

0 commit comments

Comments
 (0)