Printf function which can be directed to arbitrary places