rename log-function to function, add mkdir function