Skip to content
Prev Previous commit
Next Next commit
Add SentryLog
  • Loading branch information
jpnurmi committed Sep 3, 2025
commit 9108d19dd5336e15775d42a7d716a70bf9df24a9
31 changes: 31 additions & 0 deletions src/Sentry.Bindings.Cocoa/SwiftApiDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,37 @@ interface SentryId
nuint Hash { get; }
}

// @interface SentryLog : NSObject
[BaseType (typeof(NSObject), Name = "_TtC6Sentry9SentryLog")]
[DisableDefaultCtor]
[Internal]
interface SentryLog
{
// @property (copy, nonatomic) NSDate * _Nonnull timestamp;
[Export ("timestamp", ArgumentSemantic.Copy)]
NSDate Timestamp { get; set; }

// @property (nonatomic, strong) SentryId * _Nonnull traceId;
[Export ("traceId", ArgumentSemantic.Strong)]
SentryId TraceId { get; set; }

// @property (nonatomic) enum SentryStructuredLogLevel level;
[Export ("level", ArgumentSemantic.Assign)]
SentryStructuredLogLevel Level { get; set; }

// @property (copy, nonatomic) NSString * _Nonnull body;
[Export ("body")]
string Body { get; set; }

// @property (copy, nonatomic) NSDictionary<NSString *,SentryStructuredLogAttribute *> * _Nonnull attributes;
[Export ("attributes", ArgumentSemantic.Copy)]
NSDictionary<NSString, NSObject> Attributes { get; set; }

// @property (nonatomic, strong) NSNumber * _Nullable severityNumber;
[NullAllowed, Export ("severityNumber", ArgumentSemantic.Strong)]
NSNumber SeverityNumber { get; set; }
}

// @interface SentryLogger : NSObject
[BaseType (typeof(NSObject), Name = "_TtC6Sentry12SentryLogger")]
[DisableDefaultCtor]
Expand Down
11 changes: 11 additions & 0 deletions src/Sentry.Bindings.Cocoa/SwiftStructsAndEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ internal enum SentryLevel : ulong
Fatal = 5
}

[Native]
internal enum SentryStructuredLogLevel : long
{
Trace = 0,
Debug = 1,
Info = 2,
Warn = 3,
Error = 4,
Fatal = 5
}

[Native]
internal enum SentryProfileLifecycle : long
{
Expand Down
Loading