Boost logo

Boost Users :

Subject: [Boost-users] boost logger architecture.
From: Savva Kuznetsov (Savva.Kuznetsov_at_[hidden])
Date: 2014-09-23 11:05:26


Hello, guys.

This post is almost the entire duplicate of my Ticket #10524.

We're using boost logger in our application and it's really great boost library part. But, we need to change some of it's functionality. Actually, we need to add some lines of code in a method of collector class (for example, file_collector from boost\log\sinks\text_file_backend.cpp)

I guess the right way to do this is inheritance from file_collector class and redefinition of it's members functions. But, since it's entire declaration and definition are in text_file_backend.cpp file in an anonymous namespace, it's impossible. Also, it would be cool to use some functions that this class uses (these functions are in text_file_backend.cpp file too for some unknown reason).

The only solution I see is to copy-and-paste the entire file_collector class code from boost\log\sinks\text_file_backend.cpp and rewrite some of it's methods content, but, it's obviously wrong and not beautiful way (not boost-way). I guess boost must provide an extensible way to do things. Is there any reason that the entire class is in text_file_backend.cpp file or maybe I am missing something?

My ticket have been closed by the author of logger with the comment: "file_collector in text_file_backend.cpp is not designed to be extensible because the interface for the extension is not clear. This made the implementation simpler."

It's kinda strange reason, is it?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net