Improve logging logic in `salt/template.py`. Allow the test suite to set/handle more logging levels

Improve logging logic in `salt/template.py`. Allow the test suite to set/handle more logging levels.

@thatch45, if only I knew what you were after, I'd get you the proper answer.