analytic method

void analytic({
  1. required String name,
  2. String? value,
  3. bool addToCrashReports = true,
  4. String? location,
  5. Map<String, Object?>? parameters,
  6. String? tag,
})

Logs an analytic name with LogLevel.analytic as debugPrint.

Also tries to send the log to your CrashReportsInterface implementation should you have configured one with the Loglytics.setUp method.

Implementation

void analytic({
  required String name,
  String? value,
  bool addToCrashReports = true,
  String? location,
  Map<String, Object?>? parameters,
  String? tag,
}) {
  const logLevel = LogLevel.analytic;
  if (level.skipLog(logLevel)) return;
  var message = '$name${value != null ? ': $value' : ''}'
      '${parameters != null ? ': $parameters' : ''}';
  _logMessage(
    message: message,
    logLevel: logLevel,
    addToCrashReports: addToCrashReports,
    location: location,
    tag: tag,
  );
  if (broadcastLogs) analyticsObserver.add(message);
}