(Bug 4844) Pass in a $log sub

So that context may determine where this warning should be printed.