made a logging function