6
6
// Status: WIP
7
7
// ID: 34756F646CF7AC3DBE2A8E0B344C962F
8
8
9
+ internal import OpenGraphShims
9
10
#if canImport(os)
10
11
import os. signpost
11
12
#endif
@@ -26,7 +27,37 @@ struct Signpost {
26
27
27
28
static let render = Signpost ( style: . kdebug( 0 ) , stability: . published)
28
29
static let renderUpdate = Signpost ( style: . kdebug( 0 ) , stability: . published)
29
- static let viewHost = Signpost ( style: . kdebug( 0 ) , stability: . published)
30
+ static let viewHost = Signpost ( style: . kdebug( 9 ) , stability: . published)
31
+ static let bodyInvoke = Signpost ( style: . kdebug( 5 ) , stability: . published)
32
+
33
+ @_transparent
34
+ @inline ( __always)
35
+ func traceInterval< R> (
36
+ object: AnyObject ? = nil ,
37
+ _ message: StaticString ? ,
38
+ closure: ( ) -> R
39
+ ) -> R {
40
+ guard isEnabled else {
41
+ return closure ( )
42
+ }
43
+ // TODO
44
+ return closure ( )
45
+ }
46
+
47
+ @_transparent
48
+ @inline ( __always)
49
+ func traceInterval< R> (
50
+ object: AnyObject ? = nil ,
51
+ _ message: StaticString ? ,
52
+ _ arguments: @autoclosure ( ) -> [ CVarArg ] ,
53
+ closure: ( ) -> R
54
+ ) -> R {
55
+ guard isEnabled else {
56
+ return closure ( )
57
+ }
58
+ // TODO
59
+ return closure ( )
60
+ }
30
61
}
31
62
32
63
extension Signpost {
@@ -43,4 +74,14 @@ extension Signpost {
43
74
}
44
75
}
45
76
46
-
77
+ @_transparent
78
+ @inline ( __always)
79
+ // FIXME
80
+ func traceRuleBody< R> ( _ type: Any . Type , body: ( ) -> R ) -> R {
81
+ Signpost . bodyInvoke. traceInterval (
82
+ " %{public}@.body [in %{public}@] " ,
83
+ [ OGTypeID ( type) . description, Tracing . libraryName ( defining: type) ]
84
+ ) {
85
+ body ( )
86
+ }
87
+ }
0 commit comments