Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Add event tags

Ilyaa7f258a4e84a
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index de954c6a0..b1502779f 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -133,6 +133,10 @@ impl App {
}
async fn set_start_recording_options(&mut self, new_options: RecordingOptions) {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("cmd", "set_start_recording_options");
+ });
+
match CapWindowId::Camera.get(&self.handle) {
Some(window) if new_options.camera_label().is_none() => {
println!("closing camera window");
@@ -566,6 +570,10 @@ async fn copy_file_to_path(app: AppHandle, src: String, dst: String) -> Result<(
#[tauri::command]
#[specta::specta]
async fn copy_screenshot_to_clipboard(app: AppHandle, path: PathBuf) -> Result<(), String> {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("cmd", "copy_screenshot_to_clipboard");
+ });
+
println!("Copying screenshot to clipboard: {:?}", path);
let image_data = match tokio::fs::read(&path).await {
@@ -622,6 +630,7 @@ async fn copy_screenshot_to_clipboard(app: AppHandle, path: PathBuf) -> Result<(
);
}
+ // TODO(Ilya) (Windows) Add support
#[cfg(not(target_os = "macos"))]
{
notifications::send_notification(
diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs
index b6e3b82cd..0c376ce9c 100644
--- a/apps/desktop/src-tauri/src/main.rs
+++ b/apps/desktop/src-tauri/src/main.rs
@@ -16,8 +16,11 @@ fn main() {
{
let msg = event.message.clone().unwrap_or("No message".into());
println!("Sentry captured {}: {}", &event.level, &msg);
- println!("Sentry user: {:?}", &event.user);
+ println!("-- user: {:?}", &event.user);
+ println!("-- event tags: {:?}", &event.tags);
+ println!("-- event contexts: {:?}", &event.contexts);
Some(event)
+ // None
}
#[cfg(not(debug_assertions))]
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index c44a44cf1..004ff2d26 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -38,6 +38,10 @@ pub fn list_cameras() -> Vec<String> {
#[tauri::command]
#[specta::specta]
pub async fn start_recording(app: AppHandle, state: MutableState<'_, App>) -> Result<(), String> {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("cmd", "start_recording");
+ });
+
let mut state = state.write().await;
let id = uuid::Uuid::new_v4().to_string();
@@ -56,6 +60,10 @@ pub async fn start_recording(app: AppHandle, state: MutableState<'_, App>) -> Re
.unwrap_or(false);
if auto_create_shareable_link {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("task", "auto_create_shareable_link");
+ });
+
if let Ok(Some(auth)) = AuthStore::get(&app) {
if auth.is_upgraded() {
// Pre-create the video and get the shareable link
@@ -131,6 +139,10 @@ pub async fn resume_recording(state: MutableState<'_, App>) -> Result<(), String
#[tauri::command]
#[specta::specta]
pub async fn stop_recording(app: AppHandle, state: MutableState<'_, App>) -> Result<(), String> {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("cmd", "stop_recording");
+ });
+
let mut state = state.write().await;
let Some(current_recording) = state.clear_current_recording() else {
return Err("Recording not in progress".to_string())?;
diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rs
index f6b40935a..2de73c2a6 100644
--- a/crates/export/src/lib.rs
+++ b/crates/export/src/lib.rs
@@ -23,6 +23,10 @@ pub async fn export_video_to_file(
render_constants: Arc<RenderVideoConstants>,
cursor: Arc<CursorData>,
) -> Result<PathBuf, String> {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("task", "export_video_to_file");
+ });
+
let (tx_image_data, mut rx_image_data) = tokio::sync::mpsc::channel::<Vec<u8>>(4);
let output_folder = output_path.parent().unwrap();