Add loglevel library for easier logging/debugging
convert to log library for existing logging