Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#8840 closed Bugs (fixed)

Missing severity level string in log records

Reported by: lcarreon@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

I have been trying to get some assistance on this issue from the Boost Users mailing list for more than a week but I have not had a reply that resolved the issue thus I have decided to log it as a bug.

The issue I am having is that the severity level string is not appearing in the log records generated from my test program.

I am attaching my complete test program, settings file and sample result file.

Attachments (3)

test_logging.cpp (4.1 KB ) - added by lcarreon@… 9 years ago.
Contain my complete test program
LogSettings.txt (265 bytes ) - added by lcarreon@… 9 years ago.
The settings file used by my test program
test_logging_0.log (369 bytes ) - added by lcarreon@… 9 years ago.
The resulting log records from my test program

Download all attachments as: .zip

Change History (6)

by lcarreon@…, 9 years ago

Attachment: test_logging.cpp added

Contain my complete test program

by lcarreon@…, 9 years ago

Attachment: LogSettings.txt added

The settings file used by my test program

by lcarreon@…, 9 years ago

Attachment: test_logging_0.log added

The resulting log records from my test program

comment:1 by Andrey Semashev, 9 years ago

Resolution: fixed
Status: newclosed

You need to register your severity attribute in the library before parsing the settings file. See here. The attribute may have to be registered both for formatter and filter parsers, if you want to filter records based on severity level.

comment:2 by lcarreon@…, 9 years ago

OK, this is working but I had to add a stream input/extraction function and then I had to add the following two lines before loading the settings from the settings file:

logging::register_simple_formatter_factory<ESeverityLevel, char>("Severity"); logging::register_simple_filter_factory<ESeverityLevel, char>("Severity");

comment:3 by anonymous, 6 years ago

It would be really great to put this note in the documentation when talking about the severity levels output and formats, there are people loosing like 2 days because it is not clear right away.

Note: See TracTickets for help on using tickets.