Adding log in functions