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

Using dart:developer's log instead of print unexpectedly shuffles the log lines #181

Open
lucavenir opened this issue Feb 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lucavenir
Copy link

Describe the bug
Take this configuration:

import 'dart:developer' as developer;
import 'package:talker_flutter/talker_flutter.dart';

final talker = Talker(
  logger: TalkerLogger(
    output: (String message) => message.split('\n').forEach(developer.log),
  ),
);

It will output logs like so:

[log] │ [route] | 19:50:08 974ms | Open route named /splash
[log] │ Arguments: {}
[log] ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[log] └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Or:

[log] │ [http-response] [GET] https://api.weatherapi.com/v1/current.json?key=mykey&q=location
[log] │ Status: 200
[log] │ Message: OK
[log] │ Data: {
[log] │   "location": { ... },
[log] │   "current": { ... }
[log] │ }
[log] ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[log] └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Expected behavior
The logs, sorted as they they come

Details:
Compiling from Linux, target Android

Additional context
I'm trying out log because I want to get rid of the I/flutter annoying prefixes, somehow.
If you show me how to get rid of that without using log, I'll gladly close this issue.

Workarounds
None. I'm using debugPrintSynchronously from flutter/foundation as of now.

@Frezyx Frezyx added the bug Something isn't working label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants