Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/sentry-cocoa.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=8.57.2
version=9.0.0-alpha.0
repo=https://github.com/getsentry/sentry-cocoa
10 changes: 2 additions & 8 deletions project/test/suites/test_event_json.gd
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,10 @@ func test_event_json_sdk_interface() -> void:
.must_end_with(".godot") \
.verify()

var version_regex := RegEx.create_from_string(r"^\d+\.\d+\.\d+(?:-[a-zA-Z]+\.\d+)?$")
assert_json(json).describe("Has SDK version with semantic versioning format") \
.at("/sdk/version") \
.is_string() \
.is_not_empty() \
.must_satisfy("valid version string", func(candidate) -> bool:
if not candidate is String:
return false
for part in candidate.split("."):
if not part.is_valid_int() or part.to_int() < 0:
return false
return true
) \
.must_match_regex(version_regex) \
.verify()
1 change: 1 addition & 0 deletions src/sentry/cocoa/cocoa_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import <UIKit/UIKit.h>
#endif
#import <Sentry/Sentry-Swift.h>
#import <Sentry/SentryId.h>

namespace objc {

Expand Down
42 changes: 21 additions & 21 deletions src/sentry/cocoa/cocoa_log.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,54 @@

namespace {

SentryStructuredLogAttribute *_as_attribute(const Variant &p_variant) {
SentryLogAttribute *_as_attribute(const Variant &p_variant) {
switch (p_variant.get_type()) {
case Variant::BOOL:
return [[SentryStructuredLogAttribute alloc] initWithBoolean:(bool)p_variant];
return [[SentryLogAttribute alloc] initWithBoolean:(bool)p_variant];
case Variant::INT:
return [[SentryStructuredLogAttribute alloc] initWithInteger:(int64_t)p_variant];
return [[SentryLogAttribute alloc] initWithInteger:(int64_t)p_variant];
case Variant::FLOAT:
return [[SentryStructuredLogAttribute alloc] initWithDouble:(double)p_variant];
return [[SentryLogAttribute alloc] initWithDouble:(double)p_variant];
default:
return [[SentryStructuredLogAttribute alloc] initWithString:sentry::cocoa::string_to_objc(p_variant)];
return [[SentryLogAttribute alloc] initWithString:sentry::cocoa::string_to_objc(p_variant)];
}
}

sentry::LogLevel _log_level_from_objc(SentryStructuredLogLevel p_level) {
sentry::LogLevel _log_level_from_objc(SentryLogLevel p_level) {
switch (p_level) {
case SentryStructuredLogLevelTrace:
case SentryLogLevelTrace:
return sentry::LOG_LEVEL_TRACE;
case SentryStructuredLogLevelDebug:
case SentryLogLevelDebug:
return sentry::LOG_LEVEL_DEBUG;
case SentryStructuredLogLevelInfo:
case SentryLogLevelInfo:
return sentry::LOG_LEVEL_INFO;
case SentryStructuredLogLevelWarn:
case SentryLogLevelWarn:
return sentry::LOG_LEVEL_WARN;
case SentryStructuredLogLevelError:
case SentryLogLevelError:
return sentry::LOG_LEVEL_ERROR;
case SentryStructuredLogLevelFatal:
case SentryLogLevelFatal:
return sentry::LOG_LEVEL_FATAL;
default:
return sentry::LOG_LEVEL_INFO;
}
}

SentryStructuredLogLevel _log_level_to_objc(sentry::LogLevel p_level) {
SentryLogLevel _log_level_to_objc(sentry::LogLevel p_level) {
switch (p_level) {
case sentry::LOG_LEVEL_TRACE:
return SentryStructuredLogLevelTrace;
return SentryLogLevelTrace;
case sentry::LOG_LEVEL_DEBUG:
return SentryStructuredLogLevelDebug;
return SentryLogLevelDebug;
case sentry::LOG_LEVEL_INFO:
return SentryStructuredLogLevelInfo;
return SentryLogLevelInfo;
case sentry::LOG_LEVEL_WARN:
return SentryStructuredLogLevelWarn;
return SentryLogLevelWarn;
case sentry::LOG_LEVEL_ERROR:
return SentryStructuredLogLevelError;
return SentryLogLevelError;
case sentry::LOG_LEVEL_FATAL:
return SentryStructuredLogLevelFatal;
return SentryLogLevelFatal;
default:
return SentryStructuredLogLevelInfo;
return SentryLogLevelInfo;
}
}

Expand All @@ -76,7 +76,7 @@ SentryStructuredLogLevel _log_level_to_objc(sentry::LogLevel p_level) {
}

Variant CocoaLog::get_attribute(const String &p_name) const {
SentryStructuredLogAttribute *attribute = cocoa_log.attributes[string_to_objc(p_name)];
SentryLogAttribute *attribute = cocoa_log.attributes[string_to_objc(p_name)];
if (!attribute) {
return Variant();
}
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/cocoa/cocoa_sdk.mm
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
// NOTE: This only works for captureMessage(), unfortunately.
options.attachStacktrace = false;

options.experimental.enableLogs = SentryOptions::get_singleton()->get_experimental()->get_enable_logs();
options.enableLogs = SentryOptions::get_singleton()->get_experimental()->get_enable_logs();

options.initialScope = ^(objc::SentryScope *scope) {
// Add global attachments
Expand Down
Loading