moved clear log function from main to library