I ended up using this package GitHub - jacob-roth/PrintLog.jl: An incredibly simple logger! All it does is to log all outputs of `print` and `println` into a file.