created a log func