Merge "base: support logging before enter main function." am: a59c7bcc48 am: 14e66c5989
am: 84ef8c8817

Change-Id: I591ae0ecb0d03f0831c4445e8da7b236cc9d9cee