@@ -36,9 +36,9 @@ fileprivate func legacySendDataStub(_: NSData) -> Void {
36
36
37
37
@_silgen_name ( " playground_log_hidden " )
38
38
public func legacyLog< T> ( instance: T , name: String , id: Int , startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
39
- guard !PGLThreadIsLogging else { return nil }
40
- PGLThreadIsLogging = true
41
- defer { PGLThreadIsLogging = false }
39
+ guard !PGLGetThreadIsLogging ( ) else { return nil }
40
+ PGLSetThreadIsLogging ( true )
41
+ defer { PGLSetThreadIsLogging ( false ) }
42
42
43
43
let packet = LogPacket ( describingResult: instance, named: name, withPolicy: . default, startLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
44
44
@@ -73,9 +73,9 @@ public func legacyLog<T>(instance: T, name: String, id: Int, startLine: Int, end
73
73
74
74
@_silgen_name ( " playground_log_scope_entry " )
75
75
public func legacyLogScopeEntry( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
76
- guard !PGLThreadIsLogging else { return nil }
77
- PGLThreadIsLogging = true
78
- defer { PGLThreadIsLogging = false }
76
+ guard !PGLGetThreadIsLogging ( ) else { return nil }
77
+ PGLSetThreadIsLogging ( true )
78
+ defer { PGLSetThreadIsLogging ( false ) }
79
79
80
80
let packet = LogPacket ( scopeEntryWithStartLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
81
81
@@ -87,9 +87,9 @@ public func legacyLogScopeEntry(startLine: Int, endLine: Int, startColumn: Int,
87
87
88
88
@_silgen_name ( " playground_log_scope_exit " )
89
89
public func legacyLogScopeExit( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
90
- guard !PGLThreadIsLogging else { return nil }
91
- PGLThreadIsLogging = true
92
- defer { PGLThreadIsLogging = false }
90
+ guard !PGLGetThreadIsLogging ( ) else { return nil }
91
+ PGLSetThreadIsLogging ( true )
92
+ defer { PGLSetThreadIsLogging ( false ) }
93
93
94
94
let packet = LogPacket ( scopeExitWithStartLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
95
95
@@ -101,9 +101,9 @@ public func legacyLogScopeExit(startLine: Int, endLine: Int, startColumn: Int, e
101
101
102
102
@_silgen_name ( " playground_log_postprint " )
103
103
public func legacyLogPostPrint( startLine: Int , endLine: Int , startColumn: Int , endColumn: Int ) -> AnyObject ? {
104
- guard !PGLThreadIsLogging else { return nil }
105
- PGLThreadIsLogging = true
106
- defer { PGLThreadIsLogging = false }
104
+ guard !PGLGetThreadIsLogging ( ) else { return nil }
105
+ PGLSetThreadIsLogging ( true )
106
+ defer { PGLSetThreadIsLogging ( false ) }
107
107
108
108
let printedString = Thread . current. threadDictionary [ printedStringThreadDictionaryKey] as! String ? ?? " "
109
109
0 commit comments