Skip to content

Commit

Permalink
Set the group of failed log events to logevent_error
Browse files Browse the repository at this point in the history
This is to allow clean filtering of log event failures when these are
automatically caught by the system.
  • Loading branch information
c42f committed Jan 5, 2018
1 parent af7cda9 commit 63ecd06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ end
# progressively less information.
try
msg = "Exception while generating log record in module $_module at $filepath:$line"
handle_message(logger, Error, msg, _module, group, id, filepath, line; exception=err)
handle_message(logger, Error, msg, _module, :logevent_error, id, filepath, line; exception=err)
catch err2
try
# Give up and write to STDERR, in three independent calls to
Expand Down
2 changes: 1 addition & 1 deletion test/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ end

@testset "Log message exception handling" begin
# Exceptions in message creation are caught by default
@test_logs (Error,) catch_exceptions=true @info "foo $(1÷0)"
@test_logs (Error,Test.Ignored(),Test.Ignored(),:logevent_error) catch_exceptions=true @info "foo $(1÷0)"
# Exceptions propagate if explicitly disabled for the logger (by default
# for the test logger)
@test_throws DivideError collect_test_logs() do
Expand Down

0 comments on commit 63ecd06

Please sign in to comment.