@@ -171,23 +171,46 @@ extension SupabaseLogger {
171
171
}
172
172
}
173
173
174
- @inlinable
175
- @discardableResult
176
- @_unsafeInheritExecutor
177
- package func trace< R> (
178
- using logger: ( any SupabaseLogger ) ? ,
179
- @_inheritActorContext _ operation: @Sendable ( ) async throws -> R ,
180
- fileID: StaticString = #fileID,
181
- function: StaticString = #function,
182
- line: UInt = #line
183
- ) async rethrows -> R {
184
- logger? . debug ( " begin " , fileID: fileID, function: function, line: line)
185
- defer { logger? . debug ( " end " , fileID: fileID, function: function, line: line) }
186
-
187
- do {
188
- return try await operation ( )
189
- } catch {
190
- logger? . debug ( " error: \( error) " , fileID: fileID, function: function, line: line)
191
- throw error
174
+ #if compiler(>=6.0)
175
+ @inlinable
176
+ @discardableResult
177
+ package func trace< R: Sendable > (
178
+ using logger: ( any SupabaseLogger ) ? ,
179
+ _ operation: ( ) async throws -> R ,
180
+ isolation _: isolated ( any Actor ) ? = #isolation,
181
+ fileID: StaticString = #fileID,
182
+ function: StaticString = #function,
183
+ line: UInt = #line
184
+ ) async rethrows -> R {
185
+ logger? . debug ( " begin " , fileID: fileID, function: function, line: line)
186
+ defer { logger? . debug ( " end " , fileID: fileID, function: function, line: line) }
187
+
188
+ do {
189
+ return try await operation ( )
190
+ } catch {
191
+ logger? . debug ( " error: \( error) " , fileID: fileID, function: function, line: line)
192
+ throw error
193
+ }
192
194
}
193
- }
195
+ #else
196
+ @_unsafeInheritExecutor
197
+ @inlinable
198
+ @discardableResult
199
+ package func trace< R: Sendable > (
200
+ using logger: ( any SupabaseLogger ) ? ,
201
+ _ operation: ( ) async throws -> R ,
202
+ fileID: StaticString = #fileID,
203
+ function: StaticString = #function,
204
+ line: UInt = #line
205
+ ) async rethrows -> R {
206
+ logger? . debug ( " begin " , fileID: fileID, function: function, line: line)
207
+ defer { logger? . debug ( " end " , fileID: fileID, function: function, line: line) }
208
+
209
+ do {
210
+ return try await operation ( )
211
+ } catch {
212
+ logger? . debug ( " error: \( error) " , fileID: fileID, function: function, line: line)
213
+ throw error
214
+ }
215
+ }
216
+ #endif
0 commit comments