# How to find which code is generating a warning?

**URL:** https://discourse.julialang.org/t/how-to-find-which-code-is-generating-a-warning/130541
**Category:** New to Julia
**Created:** [July 7, 2025, 5:09pm UTC](https://discourse.julialang.org/t/how-to-find-which-code-is-generating-a-warning/130541 "2025-07-07T17:09:24Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![orebas](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@orebas](https://discourse.julialang.org/u/orebas)
#### Post date: [July 7, 2025, 8:39pm UTC](https://discourse.julialang.org/t/how-to-find-which-code-is-generating-a-warning/130541/3 "2025-07-07T20:39:29Z")

</div>

> [@Warning stack trace](https://discourse.julialang.org/t/warning-stack-trace/67516/2):
>
> ` redirect_stderr(open(touch(tempname()), "r"))`

This is potentially a “neat” trick. Unfortunately, I have some @info statement elsewhere in the code that trigger first. I guess I’m back to grep. ☹

---

_[View the full topic](https://discourse.julialang.org/t/how-to-find-which-code-is-generating-a-warning/130541)._
