Skip to content

Commit

Permalink
Merge pull request #190 from invenia/ah/backport-stdlib-mod-nothing
Browse files Browse the repository at this point in the history
Backport stdlib mod nothing
  • Loading branch information
arnaudh committed Oct 12, 2022
2 parents 00c6686 + 1844a4f commit c03bd20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/stdlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 1 addition & 0 deletions test/stdlib.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@testset "stdlib" begin
orig_logger = Base.CoreLogging.global_logger()
@test getlogger(nothing) == getlogger()

try
logger = getlogger("Memento")
Expand Down

2 comments on commit c03bd20

@iamed2
Copy link
Member

@iamed2 iamed2 commented on c03bd20 Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/70129

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.1 -m "<description of version>" c03bd20a1aa911cd3e8297456884d50dd9ed418d
git push origin v1.2.1

Please sign in to comment.