csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
441 stars 96 forks source link

Use package:logging and dart:developer log() instead of debugPrint #225

Closed johnpryan closed 2 years ago

johnpryan commented 2 years ago

This changes all the debugPrint and related code to use a single Logger instance, which can be toggled using setLogging(). The public API is still debugLogDiagnostics, though.

This also cleans up the test output, which can be re-enabled using the enableLogs constant in go_router_test.dart.

Also modifies some tests to use throwsException instead of a try / catch.

kevmoo commented 2 years ago

I'll defer to @csells here. Sounds good in theory!

johnpryan commented 2 years ago

@csells this should be ready for another look, minus the failing test

csells commented 2 years ago

The test isn't failing. It's not meant to throw an exception. I had that code in there to print the exception while I was debugging the behavior for which the test was written.

csells commented 2 years ago

and the test was failing but shouldn't have been. fixed.