# Prints won't show up when debugging a function

**URL:** <https://discourse.julialang.org/t/prints-wont-show-up-when-debugging-a-function/27105>\
**Category:** New to Julia\
**Tags:** debug\
**Created:** [August 2, 2019, 9:37am UTC](https://discourse.julialang.org/t/prints-wont-show-up-when-debugging-a-function/27105 "2019-08-02T09:37:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [August 2, 2019, 11:46am UTC](https://discourse.julialang.org/t/prints-wont-show-up-when-debugging-a-function/27105/5 "2019-08-02T11:46:05Z")

</div>

As an aside, I recently asked a question about using prints for debugging, similar to Python **debug**

The answer was to look at  
[https://docs.julialang.org/en/v1.1/stdlib/Logging/#Environment-variables-1](https://docs.julialang.org/en/v1.1/stdlib/Logging/#Environment-variables-1)

and

> [@@assert alternatives?](https://discourse.julialang.org/t/assert-alternatives/24775/8):
>
> +1 for outside-the-box we want the assertion macro to be able to dissolve in a released version we do not want to force the package user to start with --check-bounds=no reversing the sense of your macro forces bounds checking off when assertions are active, and that is imperfect for development fwiw years ago I found a way that worked – would be worth more with sourcetext, and maybe it worked by using aspects of very early Julia that no longer hold.

> [@Equivalent of Python if \_\_debug\_\_](https://discourse.julialang.org/t/equivalent-of-python-if-debug/25715):
>
> In Python there is a feature for simple print style debugging to be switched on or off. If you run a Python script with the -O option then if \_\_debug\_\_: print variable, variable, variable Is there an equivalent in Julia? I know you could set a constant to be true or false, bt that involves editing the code to switch on/off the debug lines.

---

_[View the full topic](https://discourse.julialang.org/t/prints-wont-show-up-when-debugging-a-function/27105)._
