To create a Logging system for a larger application, I came up with the following draft. The log sinks aren't detailed yet, but the factory method for logger creation and a rough draft of the logger itself are. Is this a good start and worth continuing? Or are there pitfalls you can see?class LoggingSink; // abstract base classclass ConsoleSink : public LoggingSink; // some concrete logging sinkclass LogfileSink : public LoggingSink; // ... too/***********************************************/class Logger {public:    void log(const std::string& msg) {        for (LoggingSink ls : Sinks)            ls.log(msg);    }private:    std::list<std::reference_wrapper<LoggingSink>> Sinks;    friend class LoggerFactory;};/***********************************************/class LoggerFactory {public:    std::unique_ptr<Logger> create() {        std::unique_ptr<Logger> result = std::make_unique<Logger>();        result->Sinks.assign(StandardAssignedSinks.begin(), StandardAssignedSinks.end());        return result;    }    void addStandardSink(LoggingSink& ls) {        Sinks.push_back(std::reference_wrapper<LoggingSink>(ls));    }private:    std::list<std::reference_wrapper<LoggingSink>> StandardAssignedSinks;};/***********************************************/int main() {    ConsoleSink cs;    LogfileSink lfs(mylogfile.txt);    LoggerFactory lf;    lf.addStandardSink(cs);  // adding as reference for polymorphism    lf.addStandardSink(lfs); // perhaps the addition of some standard sinks should be done in the constructor of LoggerFactory???    std::unique_ptr<Logger> myLogger = lf.create();    myLogger->log(Hello Log, I'm going to be injected soon!);    MyClass myClassInstance(myLogger); // constructor dependency injection    MyClass myOtherInstance(lf.create()); // direct DI}I'm also unsure about the friend class. This is something I never really liked with factories. Any ideas how to improve here?
C++11 Logging Architecture
c++;c++11;logging;factory method