Added openLog() function