# What are your favorite println debugger messages?

**URL:** https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342
**Category:** Offtopic
**Tags:** question
**Created:** [September 22, 2018, 4:55pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342 "2018-09-22T16:55:06Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [September 22, 2018, 4:55pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/1 "2018-09-22T16:55:07Z")

</div>

For those who still haven’t gotten on the Holy Rebugger train, what are your favorite println messages?

// asking to spice up my debugging game

1. 

```julia
println(111)
println(222)
println(333)
println(444)
println(555)
println(777)

```

1. 

```julia
println("woof")
println("meow")
println("bark")

```

1. 

```julia
println("asdf")
println("qwer")
println("zxcv")

```

1. 

```julia
println("hmmm")
println("ok")
println("no wai")
println("wot?")

```

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [September 22, 2018, 5:09pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/2 "2018-09-22T17:09:50Z")

</div>

Usually `println("Here")`, `println("Here2")` etc…

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [September 22, 2018, 5:23pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/3 "2018-09-22T17:23:44Z")

</div>

Another good one is

```julia
println("Please don't break again")

```

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [September 22, 2018, 5:35pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/4 "2018-09-22T17:35:26Z")

</div>

```julia
println(@ __LINE__ )

```

---

<div class="post-metadata">

### Author: ![lwhitefox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwhitefox/32/4363_2.png) [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)
#### Post date: [September 22, 2018, 6:00pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/5 "2018-09-22T18:00:18Z")

</div>

> [@StefanKarpinski](#):
>
> println(@ **LINE** )

Cool, learned something very useful today… 🕶

---

<div class="post-metadata">

### Author: ![lwhitefox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwhitefox/32/4363_2.png) [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)
#### Post date: [September 22, 2018, 6:02pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/6 "2018-09-22T18:02:22Z")

</div>

While thinking about this, is there a way to easily add the function name programmatically into `println(@ __LINE__ )`?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [September 22, 2018, 6:08pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/7 "2018-09-22T18:08:40Z")

</div>

Not the function, no, but the file name could be included like this:

```julia
println(@ __FILE__ , ":", @ __LINE__ )

```

It would be possible to have a similar `@ __FUNCTION__ ` macro. Implementing it would require tracking the name of the function that is currently being defined in the parser. And of course, one must keep in mind inner functions so technically there is a stack of function names that are currently being defined at any point in code.

---

<div class="post-metadata">

### Author: ![lwhitefox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwhitefox/32/4363_2.png) [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)
#### Post date: [September 22, 2018, 7:50pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/8 "2018-09-22T19:50:33Z")

</div>

> [@StefanKarpinski](#):
>
> Not the function, no, but the file name could be included like this:
> 
> ```julia
> println(@ __FILE__ , ":", @ __LINE__ )
> 
> ```

Thanks!

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 23, 2018, 7:47am UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/9 "2018-09-23T07:47:01Z")

</div>

```julia
@show something

```

---

<div class="post-metadata">

### Author: ![KZiemian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kziemian/32/9020_2.png) [@KZiemian](https://discourse.julialang.org/u/KZiemian)
#### Post date: [September 23, 2018, 10:17am UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/10 "2018-09-23T10:17:16Z")

</div>

The same, but in polish.

---

<div class="post-metadata">

### Author: ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)
#### Post date: [September 23, 2018, 12:15pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/11 "2018-09-23T12:15:23Z")

</div>

Can we ask pretty please for that feature? 🙂

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [September 23, 2018, 2:35pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/12 "2018-09-23T14:35:25Z")

</div>

Until that’s implemented you can just use`e.g.

```julia
st = stacktrace()
println(st)

```

in your function call.

---

<div class="post-metadata">

### Author: ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)
#### Post date: [September 23, 2018, 3:11pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/13 "2018-09-23T15:11:56Z")

</div>

I often use `@show x; error(msg)` to show `x` and then give me a stacktrace without much noise from other debugging lines.

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [September 23, 2018, 5:05pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/14 "2018-09-23T17:05:55Z")

</div>

Feel like a jedi while debugging:

```plaintext
println("hello there")

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/d/dddaf07d01ff08f893463d3ae6c6e5db6607f1b3.jpeg)

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [October 5, 2018, 6:08pm UTC](https://discourse.julialang.org/t/what-are-your-favorite-println-debugger-messages/15342/15 "2018-10-05T18:08:38Z")

</div>

For a video game theme, I use:

```julia
println("wow")
println("lol")
println("kek")

println("!")
println("?")

println("SNAKE")
println("moo")

```

// although I guess `println(@ __FILE__ , ":", @ __LINE__ )` is kind of useful 😛
