Add a general form of getLog() to make it easy to create similar functions.