Severity to String mapping

  • Anonymous - 2012-03-12

    I am using this formatter to log severity `boost::log::formatters::attr< LogLevel >("Severity")`

    I don;t like an int being printed but instead i want to map this on a string.
    so I have tried to implement a `basic_custom_mapping` to do this but i have some troubles.
    Can someone help with a little example ?


  • Andrey Semashev

    Andrey Semashev - 2012-03-12

    Simply define operator<< for your LogLevel enum and make sure it's visible from where you setup the formatter.

  • Andrey Semashev

    Andrey Semashev - 2012-03-12

    BTW, you can find this in several examples with the library, basic_usage for instance.

  • Anonymous - 2012-03-13

    thanks a lot. I have missed that example.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks