saltstack/salt — pull request #4246 by s0undt3ch (2013-03-25 09:38:01+00:00)
Title: Start logging to the console as soon as possible.

Besides having a null logging handler which fixed several annoyances, we now added a temporary stream logging handler.
We did not detect the need for this temporary logging handler in salt, but projects making use of salt, for example salt-cloud, and because of how our parsers system works, would not get some useful logging output because it was not yet setup when needed.

So, logging now works(gets setup) in the following steps.

* Null logging handler right at import time. (No more, no handler for blah)
* Temporary logging handler. If console logging is supposed to happen, a temp logging handler will be setup right after arguments/options from the console are parsed(respects `-l `), but it still does not know about any settings from the configuration files.
* Proper console logging is setup. Respects the console parsed options and also the configuration files. (Null and temp logging handlers are removed/deleted)
* Proper file logging taking into account the options set in the configuration files.