<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi All,<br><br>Is there any way, I can disable one logging Handler, while other Log Handler are still available for servicing.....<br><br>Please see the below code. It explains my Problem better.<br>I actually reduce the size of problem, to make it understandable faster<br><br><br>------------------------------------------------------------------------------------------------------------------------------<br>import logging;<br>import sys;<br><br>thelog = logging.getLogger('app.scsi.cdb');<br>strmHdlr = logging.StreamHandler(sys.stdout);<br>fHdlr = logging.FileHandler('a.log')<br><br>thelog.addHandler(strmHdlr);<br>thelog.addHandler(fHdlr);<br>thelog.setLevel(logging.DEBUG);<br><br>thelog.info('Hello Python Logger');<br>thelog.info('This is Venkata Rama Krishna');<br><br>## Now, I want to disable the strmHdlr for some moment without<br>## actually removing the
 Handler from logger Object,<br>## I want to say something like<br>##<br>## thelog.disable('StreamHandler');<br>##<br>## So., that it disables all the Stream Handlers attached to the Logger Object<br><br>## The Need for me is that, I should write My Email Id only to File Stream<br>## and because of some reasons of moduler design, I don't have references to the<br>## both the Handlers<br><br>## Here, I don't have want to do the StreamHandler removing stuff and adding it again later on<br>thelog.removeHandler(strmHdlr);<br>thelog.info('Email: bvrkchowdary@yahoo.co.in');<br><br><br>## Now, I want to re-enable the strmHdlr without<br>## actually adding the Handler to the logger Object<br>## I want to say something like<br>##<br>## thelog.enable('StreamHandler');<br>##<br>## So., that it disables all the Stream Handlers attached to the Logger Object<br><br>## Now, I can write my Phone Number to both the Streams<br><br>## Here, I don't want to do the Stream
 Handler adding stuff <br>thelog.addHandler(strmHdlr);<br>thelog.info('Phone no: +91-9985778581');<br>------------------------------------------------------------------------------------------------------------------------------<br><br>Thanking you,<br><div align="left">Venkata Rama Krishna Boddu</div>  <font color="#008080" size="2"></font></td></tr></table><br>


      <!--3--><hr size=1></hr> Explore and discover exciting holidays and getaways with Yahoo! India Travel <a href="http://in.rd.yahoo.com/tagline_Travel_1/*http://in.travel.yahoo.com/"> Click here!</a>