Do you mean that while logging to a file you want to print the logs to your screen as well?
You could try a Tee struct:
import Base.print
struct Tee <: IO
ios :: Vector{IO}
end
print(tee::Tee, x::AbstractString) = for io in tee.ios print(io, x) end
print(tee::Tee, xs...) = for io in tee.ios print(io, xs...) end
And use Tee:
f = open("a.txt", "w")
tee = Tee([f1, STDERR])
logging(tee)
info("info")
warn("warn")
But note that error is a special function that throws an error instead of just doing some logging, so this simple implementation works well with just info and warn.
Or you can use the unix tee command like this (and no need for logging(f)):
$ julia --color=yes testlog.jl 2> >(tee testlog.txt)