Skip to content

Commit

Permalink
chore: improve error logging when capturing snapshots (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Jan 8, 2025
1 parent bf73f78 commit 4fa34da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- chore: improve error logging when capturing snapshots ([#146](https://github.com/PostHog/posthog-flutter/pull/146))

## 4.9.1

- fix: blank screen when viewing session replay recordings ([#139](https://github.com/PostHog/posthog-flutter/pull/139))
Expand Down
2 changes: 0 additions & 2 deletions lib/src/posthog_widget_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:posthog_flutter/posthog_flutter.dart';
import 'package:posthog_flutter/src/replay/mask/posthog_mask_controller.dart';
import 'package:posthog_flutter/src/util/logging.dart';

import 'replay/change_detector.dart';
import 'replay/native_communicator.dart';
Expand Down Expand Up @@ -74,7 +73,6 @@ class PostHogWidgetState extends State<PostHogWidget> {

final imageInfo = await _screenshotCapturer?.captureScreenshot();
if (imageInfo == null) {
printIfDebug('Error: Failed to capture screenshot.');
return;
}

Expand Down
5 changes: 3 additions & 2 deletions lib/src/replay/screenshot/screenshot_capturer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class ScreenshotCapturer {
}

if (const PHListEquality().equals(pngBytes, statusView.imageBytes)) {
printIfDebug('Snapshot is the same as the last one.');
printIfDebug(
'Debug: Snapshot is the same as the last one, nothing changed, do nothing.');
image.dispose();
return null;
}
Expand Down Expand Up @@ -156,7 +157,7 @@ class ScreenshotCapturer {
_updateStatusView(shouldSendMetaEvent, renderObject, statusView);
return imageInfo;
} catch (e) {
printIfDebug('Error capturing image: $e');
printIfDebug('Error: Capturing image: $e');
return null;
}
}
Expand Down

0 comments on commit 4fa34da

Please sign in to comment.