move set_loglevel to tools
set default loglevel to warning