modify PatternMgr.py to use logging
modify Kernel.py to use logging and replace whitespace