mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-05 09:26:32 +00:00
crash: try to attach dimensions to the crash report
This commit is contained in:
@@ -14,6 +14,14 @@ pub fn captureEvent(value: Value) ?UUID {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
pub fn setContext(key: []const u8, value: Value) void {
|
||||
c.sentry_set_context_n(key.ptr, key.len, value.value);
|
||||
}
|
||||
|
||||
pub fn removeContext(key: []const u8) void {
|
||||
c.sentry_remove_context_n(key.ptr, key.len);
|
||||
}
|
||||
|
||||
pub fn setTag(key: []const u8, value: []const u8) void {
|
||||
c.sentry_set_tag_n(key.ptr, key.len, value.ptr, value.len);
|
||||
}
|
||||
|
@@ -24,6 +24,22 @@ pub const Value = struct {
|
||||
) };
|
||||
}
|
||||
|
||||
pub fn initObject() Value {
|
||||
return .{ .value = c.sentry_value_new_object() };
|
||||
}
|
||||
|
||||
pub fn initString(value: []const u8) Value {
|
||||
return .{ .value = c.sentry_value_new_string_n(value.ptr, value.len) };
|
||||
}
|
||||
|
||||
pub fn initBool(value: bool) Value {
|
||||
return .{ .value = c.sentry_value_new_bool(@intFromBool(value)) };
|
||||
}
|
||||
|
||||
pub fn initInt32(value: i32) Value {
|
||||
return .{ .value = c.sentry_value_new_int32(value) };
|
||||
}
|
||||
|
||||
pub fn decref(self: Value) void {
|
||||
c.sentry_value_decref(self.value);
|
||||
}
|
||||
@@ -35,4 +51,14 @@ pub const Value = struct {
|
||||
pub fn isNull(self: Value) bool {
|
||||
return c.sentry_value_is_null(self.value) != 0;
|
||||
}
|
||||
|
||||
/// sentry_value_set_by_key_n
|
||||
pub fn setByKey(self: Value, key: []const u8, value: Value) void {
|
||||
_ = c.sentry_value_set_by_key_n(
|
||||
self.value,
|
||||
key.ptr,
|
||||
key.len,
|
||||
value.value,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user