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!

log.h

log.cc

2 Comments

  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.

Post a Comment

Your email is never shared. Required fields are marked *

*
*