Menu

boost.log v2 beta 1 comments

2013-01-26
2013-06-03
  • Volker Prüß

    Volker Prüß - 2013-01-26

    (revision 814)

    I saw that our favourite library makes huge steps towards v2 so I tried the new interface. I didn't find any hints about the preferred channel for comments so - here are my first findings :

    In file settings_parser method parse_settings never returns in case the given stream is invalid :

    std::ifstream settings( "non_existent_file.txt");
    boost::log::init_from_stream(settings);
    

    I added an additional test for the other stream flags :

        while ( !(strm.fail() || strm.eof()) )
    

    which breaks the endless loop.

    Unfortunately even after correcting this parsing the typical configuration files fails as soon the spirit parser hits the first line with substantial information (''). The same happens with the next line in case I comment the section identifier. I tried the standard example (libs/log/example/settings_file) - same result. I was unable to deduce the origin for this failure until now …

    Regards

    Volker

     
  • Andrey Semashev

    Andrey Semashev - 2013-01-26

    Thanks for the feedback, I'll correct the loop condition. Could you specify your platform, compiler and Boost version?

     
  • Volker Prüß

    Volker Prüß - 2013-01-26

    Sure.

    Platform :  Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-36-generic x86_64)
    Compiler : gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
    boost version : 1.52.0

    I poked a little bit in the parser and IMHO the expression parsing the section_name is malformed (the graph also eats the closing square bracket). I replaced the rule as follows :

            section_name =
                qi::raw[ qi::lit(constants::char_section_bracket_left) >> +(encoding_specific::graph - constants::char_section_bracket_right) >>
                    constants::char_section_bracket_right ]
                    [boost::bind(&this_type::set_section_name, this, _1)] >>
                -comment;
    
     
  • Andrey Semashev

    Andrey Semashev - 2013-01-27

    I have thought about the endless loop a bit more and I think the suggested change is not correct. The failbit may get set in the stream before the end of stream occurs (and it does get set in my tests), so stopping the loop on it is not right. OTOH providing an invalid stream as an argument is an error on the user's side, and such errors are typically not checked for. But I guess I can add the check and an exception for just this case.

     
  • Andrey Semashev

    Andrey Semashev - 2013-01-27

    The updated code is in trunk.

     
  • Vlad

    Vlad - 2013-04-01

    Hi Andrey,

    Very glad to see this project alive and moving forward to become a part of boost.

    Could you please advise a status of v2? Do you have any date in mind for a stable release?

    Many thanks in advance,
    Volodya

     
  • Andrey Semashev

    Andrey Semashev - 2013-04-01

    v2 is stable, it's undergoing the fast track review in Boost ML now. If everything goes as planned it should move to Boost trunk in a few weeks. Chances are it gets released with Boost 1.54 or 1.55.

     
  • jmo

    jmo - 2013-04-24

    Woohoo! That's awesome news! I can finally ditch my dusty old download of (boost log) trunk and move forward with vanilla boost. High five.

     

Log in to post a comment.