Created
September 30, 2018 15:32
-
-
Save Datseris/e222540d8acb94d86cdd7ecc9b487fb5 to your computer and use it in GitHub Desktop.
using debug logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> foo() = @debug "Hello, World!"; | |
julia> foo() | |
julia> withenv("JULIA_DEBUG" => "all") do | |
foo() | |
end | |
┌ Debug: Hello, World! | |
└ @ Main REPL[1]:1 | |
julia> using Logging | |
julia> logger = ConsoleLogger(stderr, Logging.Debug); | |
julia> with_logger(logger) do | |
foo() | |
end | |
┌ Debug: Hello, World! | |
└ @ Main REPL[1]:1 | |
julia> global_logger(logger) | |
ConsoleLogger(Base.TTY(RawFD(0x0000000f) open, 0 bytes waiting), Info, Logging.default_metafmt, true, 0, Dict{Any,Int64}()) | |
julia> foo() | |
┌ Debug: Hello, World! | |
└ @ Main REPL[1]:1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment