simc / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
1.07k stars 129 forks source link

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

Open SidneyMachara opened 3 years ago

SidneyMachara commented 3 years ago

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 commented 3 years ago

passing colors: false solves problem 1

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

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); }

} }