Skip to content

Commit

Permalink
Fix log message id from at-deprecate to be a Symbol.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 13, 2021
1 parent a0241b9 commit fa26381
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function depwarn(msg, funcsym; force::Bool=false)
end,
_file=String(caller.file),
_line=caller.line,
_id=(frame,funcsym),
_group=:depwarn,
frame=frame,
caller=caller,
maxlog=funcsym === nothing ? nothing : 1
)
Expand Down
8 changes: 8 additions & 0 deletions test/corelogging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ end
@test record.group == :corelogging # name of this file
end

@testset "id from @deprecate should be ::Symbol" begin
f() = Base.depwarn("msg", :f; force=true)
logs, _ = Test.collect_test_logs() do
f()
end
@test logs[1].id isa Symbol
end

@testset "complicated kwargs logging macro" begin
@test_logs (:warn, "foo") @warn "foo" argvals=:((DoNotCare{$(Expr(:escape, :Any))}(),))
end
Expand Down

0 comments on commit fa26381

Please sign in to comment.