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 <mtmor...@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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to