created log function