chore(logging): sanitize diagnostics and reduce noise

This commit is contained in:
zarzet
2026-08-31 01:49:49 +07:00
parent 8f17cd1682
commit a1ee346f2f
46 changed files with 173 additions and 301 deletions
+20
View File
@@ -31,6 +31,26 @@ void main() {
);
});
test('log buffer redacts media keys and bounds exported payloads', () {
final buffer = LogBuffer()..clear();
addTearDown(buffer.clear);
buffer.add(
LogEntry(
timestamp: DateTime(2026, 8, 31),
level: 'ERROR',
tag: 'FFmpeg',
message:
'-decryption_key raw-media-key ${List.filled(5000, 'x').join()}',
),
);
final stored = buffer.entries.single.message;
expect(stored, isNot(contains('raw-media-key')));
expect(stored, contains('[REDACTED]'));
expect(stored, endsWith('...[truncated]'));
expect(stored.length, lessThan(4100));
});
testWidgets('long press selects multiple log rows for copying', (
tester,
) async {