[Bioc-devel] best practice: verbose messages

Martin Morgan mtmorgan at fhcrc.org
Sun Jul 14 17:36:58 CEST 2013


On 07/10/2013 10:50 AM, Kasper Daniel Hansen wrote:
> On Wed, Jul 10, 2013 at 12:38 PM, Dan Tenenbaum <dtenenba at fhcrc.org> wrote:
>
>> On Wed, Jul 10, 2013 at 9:17 AM, Michael Lawrence
>> <lawrence.michael at gene.com> wrote:
>>> If it's an informational message, like one you might log, use message().
>> If
>>> you're rendering an object as text, like in a show method, use cat().
>>>
>>
>> Another thing to consider is that messages can be suppressed with
>> suppressMessages() but cat() output cannot.
>
>
> Sure.  What I cannot decide is whether that is good or bad.

Returning to this part of the thread, and mostly just 'for the record', it turns 
out that

   http://bioconductor.org/developers/package-guidelines/#messages

says

End-User Messages

* `message()` communicates diagnostic messages (e.g., progress during lengthy
   computations) during code evaluation.
* `warning()` communicates unusual situations handled by your code.
* `stop()` indicates an error condition.
* `cat()` or `print()` are used only when displaying an object to the user,
   e.g., in a `show` method.

Martin

>
> Kasper
>
>
>
>
>>
>> Dan
>>
>>
>>> Just my opinion,
>>> Michael
>>>
>>>
>>> On Wed, Jul 10, 2013 at 8:24 AM, Kasper Daniel Hansen <
>>> kasperdanielhansen at gmail.com> wrote:
>>>
>>>> Should I use cat() or message() (or something else) for
>>>>    if(verbose) cat("my message\n")
>>>>
>>>> Best,
>>>> Kasper
>>>>
>>>>          [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> Bioc-devel at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>>
>>>
>>>          [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> Bioc-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioc-devel mailing list