Logging file names and line numbers with Boost::Log

I recently started using Boost::Log, and in general, I like it.  One glaring deficiency, though, is that it doesn’t log file names and line numbers.  This is really irritating, especially since it’s such basic functionality, and it’s the one thing all logging frameworks do.  I wrote a bit of C++ that adds this by adding the file name and line number as custom attributes to the log record.  I’ve attached a sample that shows how to use it.

Happy logging!




  1. Posted July 15, 2020 at 1:10 pm | Permalink

    My brother suggested I may like this web site. He used to be totally right.
    This post actually made my day. You can not believe simply how a lot time I had spent for
    this info! Thanks!

  2. Posted July 24, 2020 at 10:11 pm | Permalink

    all the time i used to read smaller content which as well clear their motive, and that is also happening with this post which I am reading at this place.

  3. Posted April 8, 2021 at 8:12 am | Permalink

    Hi there, this weekend is good for me, for the reason that this occasion i
    am reading this fantastic educational paragraph here
    at my home.

  4. Posted April 16, 2021 at 4:44 am | Permalink

    An impressive share! I have just forwarded this onto a colleague who was
    conducting a little homework on this. And he actually ordered me dinner due to the fact that I discovered it for him…
    lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending time to talk about this subject
    here on your website.

2 Trackbacks

  1. By 고양이 종류 on May 11, 2021 at 8:13 pm

    고양이 종류

    Logging file names and line numbers with Boost::Log – Blog

  2. By 코인카지노 on May 15, 2021 at 9:55 pm


    Logging file names and line numbers with Boost::Log – Blog

Post a Comment

Your email is never shared. Required fields are marked *