Thanks @PierreRochard, yeah you’re absolutely right about that.
I was thinking about something more straightforward.
The gist of my suggestion was to just extract (or remove) WalletLogPrintf from the wallet for the advantages that this may provide.
When extracted the signature of WalletLogPrintf could look something like this:
0template<typename... Params>
1void WalletLogPrintf(const CWallet* wallet, const std::string& fmt, const Params&... parameters) {
2 ...
3};
and would be used like:
0WalletLogPrintf(pWallet, "#reckless");
Imo WalletLogPrintf meets the recommendation: “A function that can be simply, elegantly, and efficiently implemented as a freestanding function (that is, as a nonmember function) should be implemented outside the class. ” from Stroustrup.
Anyway, this comment is just to clarify what I meant. It is not critical and it’s probably best to ignore it :)