captureLog method
Implementation
@override
Future<void> captureLog({
required String body,
PostHogLogSeverity level = PostHogLogSeverity.info,
Map<String, Object>? attributes,
String? traceId,
String? spanId,
int? traceFlags,
}) async {
final normalizedAttributes =
attributes != null ? PropertyNormalizer.normalize(attributes) : null;
return handleWebMethodCall(
MethodCall('captureLog', {
'body': body,
'level': level.name,
if (normalizedAttributes != null) 'attributes': normalizedAttributes,
if (traceId != null) 'traceId': traceId,
if (spanId != null) 'spanId': spanId,
// traceFlags 0 is meaningful (W3C sampled-false); only omit when null.
if (traceFlags != null) 'traceFlags': traceFlags,
}),
);
}