Add logout function

Signed-off-by: Shi Lei <mleoshi@gmail.com>