# When to use $DEBUG and $VERBOSE

**URL:** <https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950>\
**Category:** Ruby\
**Created:** [September 23, 2009, 2:25am UTC](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950 "2009-09-23T02:25:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 23, 2009, 2:25am UTC](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950/1 "2009-09-23T02:25:19Z")

</div>

Ok, so I have a bin script and like so many other’s use some common  
options such as --verbose and --debug. Generally I have been keeping  
these flags in an options hash, specific to my app. But I wondering if  
perhaps these may just as well use the global vars. Is that a good  
practice, or are these globals specifically for something more  
specialized for use by developers and should not be used by  
applications?

If these globals are generally useful to applications, I note that a  
$NOOP global for FileUtils methods seems useful.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 23, 2009, 7:41pm UTC](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950/2 "2009-09-23T19:41:43Z")

</div>

well, setting $VERBOSE will also tamper with the display of warnings  
issued by ruby, so it depends if that is included in what you want to  
achieve  
with --verbose.

In general, you could probably tie --debug to $DEBUG since to me that’s  
a developer’s switch.

–verbose on the other hand sounds to me like it’s intended for end  
users,  
so ruby warnings to them will probably only be confusing (e.g. the  
insecure directory warning)

Greetz!

2009/9/23 Intransition [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [September 25, 2009, 2:20am UTC](https://www.ruby-forum.com/t/when-to-use-debug-and-verbose/175950/3 "2009-09-25T02:20:02Z")

</div>

On Sep 23, 1:40 pm, Fabian S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> insecure directory warning)  
> Thanks. You’re right. And that puts things into perspective for me.  
> Seems to me $VERBOSE would have been more aptly labeled $WARN --then  
> $VERBOSE would have been available for CLIs.

T.
