refactor writeToLog function
Add textfields and button for set command