misc.py: fix logskip

The intention of logskip is to change the caller information appeared in
log messages. It goes back and skip the stack frames that we do want to
ignore, then find the nearest caller frame that is not tagged as "should
skip", and use its filename, line number and function name information
as the caller information in the log message. It's useful to skip stack
frame of some utility function and log caller of the utility function.

The original logskip mechanism has two bugs. It overrides the standard
logger's findCaller method in function enableLogSkip(), however
enableLogSkip() itself will appear in the stack because the overriding
function refers a local variable "skipFunc" in the enableLogSkip(), thus
the Python interpreter has to keep the stack frame for a closure. We can
not avoid the closure so the soluion is adding function enableLogSkip()
itself to the "should skip" list.

This patch adds function enableLogSkip() itself to the "should skip"
list by prepending the "logskip" decorator to it.

Another bug is when deciding if we should skip the current frame, the
first condition branch in function _shouldLogSkip() does not properly
handle the following case. When the "logSkipName" is assigned and the
current frame's function body is not registered as skip,
_shouldLogSkip() thinks we should not skip. Howerver it's possible that
the whole source file is registered in this case, so we should skip this
frame as well. This patch fixes this problem.

Change-Id: Ib89dc6460ae33cb429ab1f170562f84dbc4010a8
Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Reviewed-on: http://gerrit.ovirt.org/14264
Reviewed-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>