I recently switched from an Intel-based Mac to an Apple Silicon Mac. In my Flutter projects, I use the log function from dart:developer to display messages in the console during debugging. However, I've observed that these messages are only visible on the terminal when I use print or debugPrint. While I can switch to using debugPrint, I prefer the distinctive yellow-colored messages as they are easier to distinguish from other terminal outputs.
Is there a workaround to view the log messages on the terminal?
import 'dart:developer';
log('message'); // does not work
print('message') // works
debugPrint('message') // works
PS: This works perfectly on the intel-based mac
You need
stdout
fromdart:io
.Here's a minimal example:
Read more about this class of dart:io library: https://api.dart.dev/stable/3.1.3/dart-io/Stdout-class.html
In case you want colored output, try using ansicolor