From rowe at muxspace.com  Thu Apr 18 18:12:26 2013
From: rowe at muxspace.com (Brian Lee Yung Rowe)
Date: Thu, 18 Apr 2013 12:12:26 -0400
Subject: [Rd] Suppress specific warnings
In-Reply-To: <516FF51E.5000907@fhcrc.org>
References: <53248767-3336-47A3-ADD7-FDD3143FCAD0@nicebread.de>
	<516FEDA8.70003@gmail.com> <516FF51E.5000907@fhcrc.org>
Message-ID: <2F5227B0-4E50-4E36-83E0-3988B23F0990@muxspace.com>

For my logging package (futile.logger) any log statements coming from a package are assigned to a package namespace. This way you have control of log messages at a package level (e.g. I can set the default log threshold to DEBUG, while package 'A' has a log threshold of WARN). 

I seems a hierarchical namespace facility would work for the below case as well. 


On Apr 18, 2013, at 9:29 AM, Martin Morgan <mtmorgan at fhcrc.org> wrote:

>> To suppress just this one, try this:
>> 
>> withCallingHandlers(x + 1:3,
>>    warning=function(w) {
>>       if (grepl("longer object length", w$message))
>>          invokeRestart("muffleWarning")
>>    } )
> 
> ...which are then caught as
> 
>  withCallingHandlers({
>      warning(w)                   # 'curves'; caught
>      warning("another warning")
>  }, curves=function(w) invokeRestart("muffleWarning"))
> 
> The tricky part is to come up with an appropriate scheme for classifying warnings.

?????
Brian Lee Yung Rowe
917 496 4583



[Rd] Suppress specific warnings
Brian Lee Yung Rowe