Reputation: 14561
I am trying to write a custom logger. Currently, when I log, I just get the name of the error and what line it occurred on. If I want to log the full stack trace, I thought I would use the LogLevel from the docs but it's not clear how I would use that to capture a full stack trace. I have the following right now:
using Logging
io = open("log.txt", "w+")
LogLevel(1000001) # see https://github.com/JuliaLang/julia/blob/2d5741174ce3e6a394010d2e470e4269ca54607f/base/logging.jl#L90-L98
logger = SimpleLogger(io)
global_logger(logger)
try
a+1
catch e
@warn "failure" exception=e
@info("a global log message")
end
close(io)
Upvotes: 3
Views: 694