adding print2log function