add logging to file for mclient, refactor log.h for vclient