
11 Jun
2010
11 Jun
'10
9:16 a.m.
Hi Andrey, Thanks for your reply!
If you emit log records from the basic logger (not the one with severity level), the record doesn't contain the severity level attached. The filter throws because it doesn't find it in the record.
You can change the filter in two ways to avoid the exception:
1. flt::attr< severity_level>("Severity", std::nothrow)>= level
This works fine for me.
That way the filter will silently drop all records without the level attached.
2. !flt::has_attr< severity_level>("Severity") || flt::attr< severity_level>("Severity")>= level
That way it will pass all records without the level.
I tried something in this direction, but didnt get it quite right before. Thanks for clarifying - Best, Dirk