refactoring logger
add levels to logger