logger icon indicating copy to clipboard operation
logger copied to clipboard

IOS -> can't click on printed log and no colour

Open SidneyMachara opened this issue 3 years ago • 2 comments

  1. on iphone i cant click on the printed log so it opens the location of the log.
  2. all logs are blue, even if i do logger.e("") <-- this is suppose to be red but its blue

SidneyMachara avatar Jul 22 '21 09:07 SidneyMachara

passing colors: false solves problem 1

var logger = Logger(
  printer: PrettyPrinter(
    colors: false, // <-- this line seems to solve problem 1
  ),
);

SidneyMachara avatar Jul 22 '21 09:07 SidneyMachara

This issue is a bit complex, but we could solve it by changing logger/outputs/console_output.dart to below:

import 'dart:io'; import 'dart:developer' as developer; import 'package:flutter/foundation.dart'; import 'package:idealab/plugins/logger/log_output.dart'; import 'package:idealab/plugins/logger/logger.dart';

const bool _kReleaseMode = kReleaseMode; /// Default implementation of [LogOutput]. /// /// It sends everything to the system console. class ConsoleOutput extends LogOutput { @override void output(OutputEvent event) { if (_kReleaseMode || !Platform.isIOS ) { event.lines.forEach(debugPrint); } else { event.lines.forEach(developer.log); }

} }

yushihang avatar Dec 09 '21 04:12 yushihang