Opened 9 years ago
#9292 new Bugs
event_log example crashes.
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | log |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In supplied event_log_messages.mc:
SeverityNames=(Debug=0x0:MY_SEVERITY_DEBUG
Info=0x1:MY_SEVERITY_INFO Warning=0x2:MY_SEVERITY_WARNING Error=0x3:MY_SEVERITY_ERROR )
Which translates into:
Define the severity codes #define MY_SEVERITY_WARNING 0x2 #define MY_SEVERITY_INFO 0x0 #define MY_SEVERITY_ERROR 0x3
in the generated event_log_messages.h
When trying to execute the code:
type_mapping[error] = sinks::event_log::make_event_type(MY_SEVERITY_ERROR);
in supplied main.cpp
the call to make_event_type throws out_of_range, because only levels 0, 1, 2, and 4 are allowed.