Skip to content

Commit a36662e

Browse files
committed
Explain colors, auto detections and IDEs
1 parent cae241a commit a36662e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,15 @@ var logger = Logger(
8989
)
9090
```
9191

92+
### Auto detecting
9293

93-
You can try to auto detect if the attached terminal supports ANSI escape
94-
characters by using the output of `io.stdout.supportsAnsiEscapes` as value for
95-
the `colors` argument (assuming you have imported the `io` package with `import 'dart:io' as io;`).
94+
With the `io` package you can auto detect the `lineLength` and `colors` arguments.
95+
Assuming you have imported the `io` package with `import 'dart:io' as io;` you
96+
can auto detect `colors` with `io.stdout.supportsAnsiEscapes` and `lineLength`
97+
with `io.stdout.terminalColumns`.
98+
99+
You should probably do this unless there's a good reason you don't want to
100+
import `io`, for example when using this library on the web.
96101

97102
## LogFilter
98103

@@ -128,6 +133,11 @@ class MyPrinter extends LogPrinter {
128133

129134
If you created a cool `LogPrinter` which might be helpful to others, feel free to open a pull request. :)
130135

136+
### Colors
137+
138+
Please note that all IDEs (VSCode, XCode, Android Studio, IntelliJ) do not
139+
support ANSI escape sequences in their terminal outputs. These escape sequences
140+
are used to color output. If using such an IDE do not configure colored output.
131141

132142
## LogOutput
133143

0 commit comments

Comments
 (0)