Skip to content

Commit d8e2110

Browse files
authored
Avoid os_log decoding errors in perception check (#150)
We currently pretty-print a diff format using a figure space, which is in the range of unicode that results in an error being printed to the console instead of the log message. While the message is a little less readable without the diff, removing this formatting fixes the error. Fixes #148.
1 parent 3b98607 commit d8e2110

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Sources/PerceptionCore/Perception/PerceptionRegistrar.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -264,31 +264,31 @@ extension PerceptionRegistrar: Hashable {
264264
Use this warning's stack trace to locate the view in question and wrap it with a \
265265
'WithPerceptionTracking' view. For example:
266266
267-
\u{2007} var body: some View
268-
\u{002B} WithPerceptionTracking {
269-
\u{2007} // ...
270-
\u{002B} }
271-
\u{2007} }
267+
var body: some View
268+
WithPerceptionTracking {
269+
// ...
270+
}
271+
}
272272
273273
This must also be done for any subviews with escaping trailing closures, such as \
274274
'GeometryReader':
275275
276-
\u{2007} GeometryReader { proxy in
277-
\u{002B} WithPerceptionTracking {
278-
\u{2007} // ...
279-
\u{002B} }
280-
\u{2007} }
276+
GeometryReader { proxy in
277+
WithPerceptionTracking {
278+
// ...
279+
}
280+
}
281281
282282
If a view is using a binding derived from perceptible '@State', use \
283283
'@Perception.Bindable', instead. For example:
284284
285-
\u{2007} @State var model = Model()
286-
\u{2007} var body: some View
287-
\u{2007} WithPerceptionTracking {
288-
\u{002B} @Perception.Bindable var model = model
289-
\u{2007} Stepper("\\(count)", value: $model.count)
290-
\u{2007} }
291-
\u{2007} }
285+
@State var model = Model()
286+
var body: some View
287+
WithPerceptionTracking {
288+
@Perception.Bindable var model = model
289+
Stepper("\\(count)", value: $model.count)
290+
}
291+
}
292292
293293
"""
294294
)

0 commit comments

Comments
 (0)