code refine

   1. split out log format
   2. connection retry
   3. unit test script
   4. modify protobuf

Change-Id: Ia671a83e0e30b363f1030ddd93d6663a15b12d38