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