From: Robert Klemme Date: 2003-07-30T11:27:29+09:00 Subject: Re: Warnings? "Yukihiro Matsumoto" schrieb im Newsbeitrag news:1059507455.553355.1938.nullmailer@picachu.netlab.jp... > Hi, > > In message "Re: Warnings?" > on 03/07/30, Michael Davis writes: > > |How about a way to trap warnings similar to rescue Exception so we can trap and suppress certain expected warnings? > > Since warning is a mere message, not exit like exceptions, it is more > difficult to catch. You can suppress warning messages by redirecting > $stderr temporarily (although it's not thread safe). The approach most reasonable is IMHO to provide a warning handler setting mechanism similarly to the trace handler. Only I don't know how much runtime overhead that'd be. The handler block could receive something like |level, code, message, sender| and treat it appropriately. -W0, -W1 etc. would then change the block's filtering according to level. Or should we use a mature logging feature? Maybe http://sourceforge.net/projects/log4r/ or a smaller solution. Matz, what do you think? Regards robert