# Multiple levels of debug logging

**URL:** https://discourse.julialang.org/t/multiple-levels-of-debug-logging/15048
**Category:** General Usage
**Created:** [September 17, 2018, 5:55am UTC](https://discourse.julialang.org/t/multiple-levels-of-debug-logging/15048 "2018-09-17T05:55:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [September 17, 2018, 5:55am UTC](https://discourse.julialang.org/t/multiple-levels-of-debug-logging/15048/1 "2018-09-17T05:55:51Z")

</div>

The new [Logging utility](https://docs.julialang.org/en/v1/stdlib/Logging/#Log-event-structure-1) is very nice. However, for debug logging, I often want to have several levels of verbosity e.g.

Level 1 - function entry point  
Level 2 - debug within function body  
Level 3 - debug within some kind of loop

What would be the best way to achieve that?

---

<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 17, 2018, 6:14am UTC](https://discourse.julialang.org/t/multiple-levels-of-debug-logging/15048/2 "2018-09-17T06:14:52Z")

</div>

You can create your own LogLevel.

For reference, the `Debug` level is defined as `const Debug = LogLevel(-1000)`. Your custom level can then be defined as for example `LogLevel(-999)` for a higher importance (closer to `Info`) or e.g. `LogLevel(-1001)`, which is closer to `BelowMinLevel`. You can then log with that level using [`@logmsg`](https://docs.julialang.org/en/v1/stdlib/Logging/#Base.CoreLogging.@logmsg).
