When loaders or savers throw errors, FileIO.jl outputs error messages to stderr
and stdout
without Logging
functions or macros.
The messages are helpful in most cases, but can mess up proper log handling.
julia> using FileIO
julia> try; load(IOBuffer("\x93NUMPY!!!BROKEN!!!")); catch; end # just an example
Error encountered while load Stream{DataFormat{:NPY}, IOBuffer, Nothing}(IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=18, maxsize=Inf, ptr=1, mark=-1), nothing).
Fatal error:
julia> pkgversion(FileIO)
v"1.16.3"
julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Of course we can use Supressor.jl as a general measure.
Is there any way to suppress or redirect FileIO
(-specific) error messages?
Or is it possible to make changes related to that in FileIO.jl v1?