You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really helpful if the com.posthog.posthog.DEBUG parameter, config.debug and Posthog().debug() had an explanation, ideally directly in the code.
Future<void> main() async {
// init WidgetsFlutterBinding if not yetWidgetsFlutterBinding.ensureInitialized();
final config =PostHogConfig('YOUR_API_KEY_GOES_HERE');
config.debug =true; // <=== this here
config.captureApplicationLifecycleEvents =true;
// or EU Host: 'https://eu.i.posthog.com'
config.host ='https://us.i.posthog.com';
awaitPosthog().setup(config);
runApp(MyApp());
}
Does it do the same as Posthog().debug(true)?
Or does this code do the same as the code from the example above? I set it to false initially but then use .debug(true)?
Future<void> main() async {
// init WidgetsFlutterBinding if not yetWidgetsFlutterBinding.ensureInitialized();
final config =PostHogConfig('YOUR_API_KEY_GOES_HERE');
config.debug =false; // <=== this has changed
config.captureApplicationLifecycleEvents =true;
// or EU Host: 'https://eu.i.posthog.com'
config.host ='https://us.i.posthog.com';
awaitPosthog().setup(config);
Posthog().debug(true); // <=== this has changedrunApp(MyApp());
}
Why is this always set to true in the examples? Does it make sense to set it to true only if we’re debugging the app? Does it make a difference?
config.debug = true is just a shortcut for Posthog().debug(true), so the SDK already starts in debug mode and logs things in the console.
Calling Posthog().debug(kDebugMode); at runtime will enable and disable logging based on your needs.
Problem Statement
It would be really helpful if the
com.posthog.posthog.DEBUG
parameter,config.debug
andPosthog().debug()
had an explanation, ideally directly in the code.What does
config.debug
do in this example from the documentation? https://github.com/PostHog/posthog-flutterDoes it do the same as
Posthog().debug(true)
?Or does this code do the same as the code from the example above? I set it to
false
initially but then use.debug(true)
?Why is this always set to
true
in the examples? Does it make sense to set it totrue
only if we’re debugging the app? Does it make a difference?Solution Brainstorm
No response
The text was updated successfully, but these errors were encountered: