Create logIdGenerator outside of function declaration to make code more readable