Skip to content

Implement setLoggingEnabled for Flutter Web #201

@jaredmixpanel

Description

@jaredmixpanel

setLoggingEnabled is currently only implemented for native iOS and Android channels, because those native platforms already have an existing method that directly maps to setLoggingEnabled. Web does not, but similar functionality can be achieved via the set_config method in the JavaScript library where we can set the debug option to true or false. For example:

// Enable debug logging at runtime  
mixpanel.set_config({debug: true});  
  
// Disable debug logging at runtime    
mixpanel.set_config({debug: false});

A similar pattern already exists for setServerURL on web which actually calls set_config in the JS library:

  void handleSetServerURL(MethodCall call) {
    Map<Object?, Object?> args = call.arguments as Map<Object?, Object?>;
    String serverURL = args['serverURL'] as String;
    set_config(safeJsify({'api_host': serverURL}));
  }

This issue is to extend setLoggingEnabled support to the Flutter Web channel following that pattern.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions