Skip to content

Commit 864ed4e

Browse files
committed
simplify logHandler
1 parent b516254 commit 864ed4e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/state.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,15 @@ function global_queue(dev::MTLDevice)
5050

5151
queue = if macos_version() >= v"15"
5252
log_state_descriptor = MTLLogStateDescriptor()
53+
log_state_descriptor.level = MTL.MTLLogLevelDebug
5354
log_state = MTLLogState(dev, log_state_descriptor)
5455

5556
function log_handler(subSystem, category, logLevel, message)
56-
print(String(message))
57-
return nothing
58-
end
59-
function wrapper(subSystem, category, logLevel, message)
60-
log_handler(subSystem == nil ? nothing : NSString(subSystem),
61-
category == nil ? nothing : NSString(category),
62-
logLevel,
63-
message == nil ? nothing : NSString(message)
64-
)
57+
print(String(NSString(message)))
6558
return nothing
6659
end
6760

68-
block = @objcblock(wrapper, Nothing, (id{NSString}, id{NSString}, MTLLogLevel, id{NSString}))
61+
block = @objcblock(log_handler, Nothing, (id{NSString}, id{NSString}, NSInteger, id{NSString}))
6962

7063
@objc [log_state::id{MTLLogState} addLogHandler:block::id{NSBlock}]::Nothing
7164

0 commit comments

Comments
 (0)