use Suppressor
This commit is contained in:
parent
15de29f0bb
commit
08681d135d
2 changed files with 7 additions and 4 deletions
|
@ -7,11 +7,13 @@ version = "1.1.1"
|
|||
libportaudio_jll = "2d7b7beb-0762-5160-978e-1ab83a1e8a31"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
SampledSignals = "bd7594eb-a658-542f-9e75-4c4d8908c167"
|
||||
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
|
||||
|
||||
[compat]
|
||||
julia = "1.3"
|
||||
libportaudio_jll = "19.6.0"
|
||||
SampledSignals = "2.1.1"
|
||||
Suppressor = "0.2.0"
|
||||
|
||||
[extras]
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
module PortAudio
|
||||
|
||||
using libportaudio_jll, SampledSignals
|
||||
using libportaudio_jll: libportaudio_jll
|
||||
using SampledSignals
|
||||
using Suppressor: @capture_err
|
||||
|
||||
import Base: eltype, show
|
||||
import Base: close, isopen
|
||||
|
@ -368,9 +370,8 @@ function discard_input(source::PortAudioSource)
|
|||
end
|
||||
|
||||
function suppress_err(dofunc::Function)
|
||||
io = IOBuffer()
|
||||
redirect_stderr(dofunc, io)
|
||||
@debug String(take!(io))
|
||||
debug_message = @suppress_err dofunc()
|
||||
@debug debug_message
|
||||
end
|
||||
|
||||
function __init__()
|
||||
|
|
Loading…
Reference in a new issue