When to use @debug, @info, @warn, and @error in Julia

Viewed 1062

There are currently four different error logging levels: "@debug, @info, @warn, and @error" all of which have a different use case and implications of their use. In general, when is it appropriate to use the different logging macros?

1 Answers

From the docs:

@debug "Verbose debugging information.  Invisible by default"
@info  "An informational message"
@warn  "Something was odd.  You should pay attention"
@error "A non fatal error occurred"

Read more in the Julia docs here. In particular, it's important to note that @error does NOT throw an error, it merely logs an error and continues execution. If you want to throw an error, use the error function instead.

Related