Skip to content

Add option to disable HTTP logging in StreamFeedsClient #91

Description

@andrewmikhniuk

Issue

The stream_feeds package (v0.5.1) has a LoggingInterceptor hardcoded in StreamFeedsClientImpl (feeds_client_impl.dart:149) that always logs HTTP requests/responses to the console:

LoggingInterceptor(requestHeader: true),

This produces verbose output that clutters the debug console:

I/flutter: ╔╣ Request ║ POST  
I/flutter: ║  https://feeds.stream-io-api.com/api/v2/feeds/... 
I/flutter: ╔ Headers  
I/flutter: ╟ Authorization: eyJhbGciOiJIUzI1NiJ9... 
I/flutter: WebSocketClient: Connection state changed to Connected(...)

Proposed Solution

Add a configuration option to FeedsConfig to control logging:

class FeedsConfig {
   const FeedsConfig({
     this.enableLogging = kDebugMode, // or false by default
     // ...existing fields
   });
   
   final bool enableLogging;
}

Then conditionally add the interceptor:

if (config.enableLogging) LoggingInterceptor(requestHeader: true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions