From 12ba194cc411ab765f6ed93efe98298775515be2 Mon Sep 17 00:00:00 2001 From: Arnaud Henry Date: Mon, 10 Oct 2022 09:48:46 +0100 Subject: [PATCH 1/2] Reroute `nothing` stdlib `mod` to the root logger --- src/stdlib.jl | 4 ++++ test/stdlib.jl | 1 + 2 files changed, 5 insertions(+) diff --git a/src/stdlib.jl b/src/stdlib.jl index adcf8c1..06c0305 100644 --- a/src/stdlib.jl +++ b/src/stdlib.jl @@ -35,3 +35,7 @@ function substitute!(level::LogLevel=min_enabled_level(global_logger())) global_logger(BaseLogger(level)) notice(getlogger(@__MODULE__), "Substituting global logging with Memento") end + +# `getlogger` dispatch to reroute stdlib messages with `mod=nothing` to the root logger, +# similar to calling `getlogger` with no arguments. +getlogger(::Nothing) = getlogger() diff --git a/test/stdlib.jl b/test/stdlib.jl index 48cb9fb..ea6ec2c 100644 --- a/test/stdlib.jl +++ b/test/stdlib.jl @@ -1,5 +1,6 @@ @testset "stdlib" begin orig_logger = Base.CoreLogging.global_logger() + @test getlogger(nothing) == getlogger() try logger = getlogger("Memento") From 1844a4f3908383cf1dcc513d243fce60cfb427f6 Mon Sep 17 00:00:00 2001 From: Arnaud Henry Date: Mon, 10 Oct 2022 09:48:52 +0100 Subject: [PATCH 2/2] Set project version to 1.2.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2a8b999..a95f2f3 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "Memento" uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" license = "MIT" authors = ["Invenia Technical Computing"] -version = "1.2.0" +version = "1.2.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"