setUp static method
void
setUp({
- bool logTime = false,
- LogLevel logLevel = LogLevel.info,
- AnalyticsInterface? analyticsInterface,
- CrashReportsInterface? crashReportsInterface,
- void analytics(
- AnalyticsFactory analyticsFactory
- int? maxLinesStackTrace,
- bool combineEvents = true,
- bool addAnalyticsToCrashReports = true,
- CrashReportType crashReportType = CrashReportType.location,
Used to configure the logging and analytic abilities of the Loglytics.
Use the analyticsInterface
and crashReportsInterface
to specify your implementations
of both functionalities. This is optional as the Loglytics can also be used as a pure logger.
Populate the analytics
parameter with callbacks to your Analytics implementations.
Example: () => CounterAnalytics(), () => CookieAnalytics()
.
Implementation
static void setUp({
bool logTime = false,
LogLevel logLevel = LogLevel.info,
AnalyticsInterface? analyticsInterface,
CrashReportsInterface? crashReportsInterface,
void Function(AnalyticsFactory analyticsFactory)? analytics,
int? maxLinesStackTrace,
bool combineEvents = true,
bool addAnalyticsToCrashReports = true,
CrashReportType crashReportType = CrashReportType.location,
}) {
Log.logTime = logTime;
Log.level = logLevel;
_analyticsInterface = analyticsInterface;
_crashReportsInterface = crashReportsInterface;
if (analytics != null) {
registerAnalytics(analytics: analytics);
}
_maxLinesStackTrace = maxLinesStackTrace;
_combineEvents = combineEvents;
_addAnalyticsToCrashReports = addAnalyticsToCrashReports;
_eventBus._listen();
_isActive = true;
_crashReportType = crashReportType;
}