add logging class
add logging function and test case