stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Too many log entries per single error when using external logging

Open mkobuolys opened this issue 3 years ago • 0 comments

Please select which package this feature is related to

stream_chat_flutter

Which platforms would this feature impact?

iOS, Android

Is your feature request related to a problem?

When using external logging, a single stack trace provides too many error entries in the external logging service (this case, DataDog). Screenshot 2022-09-08 at 09 56 07

Describe the solution that you'd like

It would be nice to enable/disable this pretty logging option to provide the whole error with the stack trace in a single log entry.

Describe alternatives that you have considered

No response

Additional context

This is my Stream chat client setup:

final client = StreamChatClient(
  AppConfig.values.streamChat.apiKey,
  logLevel: kDebugMode ? Level.INFO : Level.SEVERE,
  logHandlerFunction: (record) {
    final level = record.level;

    if (level > Level.WARNING) {
      Log.error(record.error ?? record.message, record.stackTrace);
    } else if (level > Level.INFO) {
      Log.warning(record.message);
    } else {
      Log.debug(record.message);
    }
  },
);

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

mkobuolys avatar Sep 08 '22 06:09 mkobuolys