Opened 8 years ago

Closed 8 years ago

#10242 closed Bugs (invalid)

logging::core::set_filter() prevents attributes from being removed and added

Reported by: Kent Knox <kent.knox@…> Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.55.0 Severity: Problem
Keywords: set_filter remove_all_attributes Cc:

Description

I have attached a simplified repro case.

Setting a filter on the core will affect how attributes are removed an added from logger objects.

If the filter is set, removing and then adding attributes will fail on a logger object.

If no filter is set, removing and adding attributes works as expected.

Attachments (1)

boostLogger.cpp (2.5 KB ) - added by Kent Knox <kent.knox@…> 8 years ago.
Notice the comments tagged with BUG

Download all attachments as: .zip

Change History (2)

by Kent Knox <kent.knox@…>, 8 years ago

Attachment: boostLogger.cpp added

Notice the comments tagged with BUG

comment:1 by Andrey Semashev, 8 years ago

Resolution: invalid
Status: newclosed

This is not a bug. When you call remove_all_attributes on the logger the first time you also remove the severity attribute from the logger. This doesn't matter when the filter is not set since in that case severity is not used anywhere. But when the filter is set, it doesn't find the severity in the second and third log records and returns false which results in discarding these records.

Note: See TracTickets for help on using tickets.