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

Max length for log messages #190

Open
amrgetment opened this issue Feb 9, 2024 · 2 comments
Open

Max length for log messages #190

amrgetment opened this issue Feb 9, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@amrgetment
Copy link

amrgetment commented Feb 9, 2024

Is your feature request related to a problem? Please describe.
I have a bloc state and event that prints thousands of objects which slows down my app and it prints a very long log

Describe the solution you'd like
I want a way to set the max length for each log message

Additional context
I parse a CSV file with 1000 rows which makes this issue, with max length I will have cleaner logs

@Frezyx
Copy link
Owner

Frezyx commented Feb 15, 2024

Hello @amrgetment !
Great idea, I will think how we can implement that functionality in future versions

@amrgetment
Copy link
Author

amrgetment commented Feb 15, 2024

@Frezyx Thanks a lot

here for bloc messages you use settings.printStateFullData,
so same you could use settings.maxLength

  String _createMessage() {
    final sb = StringBuffer();
    sb.write(displayTitleWithTime);
    sb.write('\n$message');
    sb.write(
        '\n${'CURRENT state: ${settings.printStateFullData ? '\n${transition.currentState}' : transition.currentState.runtimeType}'}');
    sb.write(
        '\n${'NEXT state: ${settings.printStateFullData ? '\n${transition.nextState}' : transition.nextState.runtimeType}'}');
    return sb.toString();
  }
}

@Frezyx Frezyx added enhancement New feature or request good first issue Good for newcomers labels Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants