Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dart:developer for console printing #11

Open
shilangyu opened this issue Jun 1, 2023 · 0 comments
Open

Use dart:developer for console printing #11

shilangyu opened this issue Jun 1, 2023 · 0 comments
Assignees

Comments

@shilangyu
Copy link
Contributor

Theres a dedicated function in dart:developer for printing log records from package:logging: https://api.flutter.dev/flutter/dart-developer/log.html. This function takes all arguments from logging's LogRecord:

    developer.log(
      rec.message,
      name: rec.loggerName,
      error: rec.error,
      stackTrace: rec.stackTrace,
      level: rec.level.value,
      time: rec.time,
      sequenceNumber: rec.sequenceNumber,
      zone: rec.zone,
    );

I don't exactly know what it does other than printing to console, but the printing is much nicer than current's PlainTextPrintStrategy strategy. Unfortunately strategies don't allow for custom printing, just for custom string creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants