Skip to content

Commit

Permalink
Update log.jl
Browse files Browse the repository at this point in the history
global log level tracking
  • Loading branch information
arhik committed Oct 28, 2023
1 parent 186a883 commit 8aa8588
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/log.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Load WGPU
using WGPUNative
export SetLogLevel
export SetLogLevel, logLevel

global logLevel::WGPULogLevel

function logCallBack(logLevel::WGPULogLevel, msg::Ptr{Cchar})
if logLevel == WGPULogLevel_Error
Expand All @@ -24,5 +26,6 @@ function SetLogLevel(loglevel::WGPULogLevel)
logcallback = @cfunction(logCallBack, Cvoid, (WGPULogLevel, Ptr{Cchar}))
wgpuSetLogCallback(logcallback, C_NULL)
@info "Setting Log level : $loglevel"
global logLevel = loglevel
wgpuSetLogLevel(loglevel)
end
end

0 comments on commit 8aa8588

Please sign in to comment.