Skip to content

Improve logging and support diagnostic tooling #34

Open
@kkostov

Description

@kkostov

Presently, debug output from the FlutterSDK is somewhat difficult to use.

  • Debug messages from the SwiftSDK are not visible in the Flutter debug console unless the app has been started directly from Xcode. Furthermore, such messages are not usually detectable by Flutter logging frameworks.

  • Debug messages from the KotlinSDK are visible, but not very easy to control as the output can't be tagged / redirected to a logging framework.

To improve this, we can:

  • (Dart) Implement a custom abstract LogHandler class to be registered as a callback function for both SwiftSDK and KotlinSDK. The log handler drops all messages and does not print anything by default.
  • (Swift/Kotlin) The native integration for both platforms will capture all log messages and forward them to the Flutter VM.
  • (Dart) Adapt TelemetryManagerConfiguration to accept a logHandler callback as an option. Client apps can implement the longHandler and redirect messages to their preferred logging framework.
  • (Dart) Mark the existing debug option as deprecated. As a fallback, we can provide a default print() implementation when debug is set to true, this will cause a warning so developers will be prompted to migrate.

Any thoughts or comments are welcome @winsmith @Jeehut

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions