Use commandline options; Error loging function;