add the logger class and demo code