Unverified Commit 174bbf25 authored by Jonas Uekötter's avatar Jonas Uekötter Committed by GitHub

Add documentation which explains that `debugPrint` also logs in release mode (#141595)

It's confusing that `debugPrint` also prints in release mode, given that a lot (most?) other things prefixed with `debug` don't do anything in release mode. Therefore, this adds some documentation that this is indeed logging in release mode and adds an example how to disable this.

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
parent 5aa6cb85
......@@ -31,6 +31,14 @@ typedef DebugPrintCallback = void Function(String? message, { int? wrapWidth });
/// Prints a message to the console, which you can access using the "flutter"
/// tool's "logs" command ("flutter logs").
///
/// The [debugPrint] function logs to console even in [release mode](https://docs.flutter.dev/testing/build-modes#release).
/// As per convention, calls to [debugPrint] should be within a debug mode check or an assert:
/// ```dart
/// if (kDebugMode) {
/// debugPrint('A useful message');
/// }
/// ```
///
/// See also:
///
/// * [DebugPrintCallback], for function parameters and usage details.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment