I'm having trouble sending messages from a DLL's logging function to the client's logging function.
I'm fine using a function pointer like this:

DLL:

```
class InnerLogger
{
public:
    static std::function<void(const std::string& message, int level)> loggerCallback;
    static std::stringstream logMsg;
    static int logSend(LogLevel logLevel);
};

void setLoggingFunction(const std::function<void(const std::string& message, int level)>& logFunction)
{
    InnerLogger::loggerCallback = logFunction;
}

```

Client:

```

void outerLogger(const std::string& message, int level)
{
  // display/save messages
}

main()
{
    std::function<void(const std::string& message, int level)> logFunctionPtr = outerLogger;
    setLoggingFunction(logFunctionPtr);
}

```

I can use InnerLogger::logSend and outerLogger picks it up.

But I'm doing something wrong when the 'outer' logger is a class member:

(DLL is unchanged)

Client:

```
class OuterLogger
{
public:
    OuterLogger();
    ~OuterLogger();

    void logFunction(const std::string& message, int level);
};

void OuterLogger::logFunction(const std::string& message, int level)
{
    // display/save messages
}

main()
{
    OuterLogger outerLogger;
    std::function<void(const std::string& message, int level)> logFunctionPtr = outerLogger.logFunction;
    setLoggingFunction(logFunctionPtr);
}

```