How to suppress Pkg messages?

pkrysl@BlackCube MINGW64 /d/BoneShaker.jl (main)                                                                                
$ julia --quiet                                                                                                                 
   Resolving package versions...                                                                                                
  No Changes to `D:\SublimeJulia-1.9\assets\.julia-1.9.3-depot\environments\v1.9\Project.toml`                                  
  No Changes to `D:\SublimeJulia-1.9\assets\.julia-1.9.3-depot\environments\v1.9\Manifest.toml`                                 
   Resolving package versions...                                                                                                
  No Changes to `D:\SublimeJulia-1.9\assets\.julia-1.9.3-depot\environments\v1.9\Project.toml`                                  
  No Changes to `D:\SublimeJulia-1.9\assets\.julia-1.9.3-depot\environments\v1.9\Manifest.toml`                                 
  Activating project at `D:\BoneShaker.jl`                                                                                      
julia> 

Is it possible to make Julia “real quiet”?

Use the io keyword argument, like Pkg.activate(“.”; io=devnull)

4 Likes

I’ve almost used this myself, but doesn’t this also mean that errors won’t be displayed?

julia> Pkg.add("NonExisting"; io=devnull)
ERROR: The following package names could not be resolved:
 * NonExisting (not found in project, manifest or registry)
   Suggestions: NonconvexMetaheuristics NonconvexMultistart
Stacktrace:

So io is really stdio by the looks of it? It would be nice if the Pkg docstrings actually said something about io, IIRC most don’t even mention its existence.

By default io is stderr for all commands except Pkg.status where it is stdout, IIRC. This is only used for any Pkg-internal IO: in the example above Pkg.add throws an error, and the REPL frontend chooses to print this to stderr.