Use Function#bind to implement a logging function.