log-levels code changed and level test added