logStateChange static method
Log state change
Implementation
static Future<void> logStateChange({
required String stateKey,
required dynamic oldValue,
required dynamic newValue,
String? userId,
String? userEmail,
Map<String, dynamic>? metadata,
}) async {
if (!_config.enabled) return;
final event = AuditEvent(
type: AuditEventType.stateChange,
stateKey: stateKey,
oldValue: oldValue,
newValue: newValue,
userId: userId,
userEmail: userEmail,
metadata: metadata,
);
await _logEvent(event);
}