# Controlling info-level logging?

**URL:** <https://discourse.julialang.org/t/controlling-info-level-logging/34420>\
**Category:** General Usage\
**Created:** [February 10, 2020, 3:40pm UTC](https://discourse.julialang.org/t/controlling-info-level-logging/34420 "2020-02-10T15:40:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [February 10, 2020, 3:40pm UTC](https://discourse.julialang.org/t/controlling-info-level-logging/34420/1 "2020-02-10T15:40:09Z")

</div>

Is it possible to control `@info` logging, per module, like `@debug`. I need to disable info output for a module/package sometimes.

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [May 25, 2020, 2:21am UTC](https://discourse.julialang.org/t/controlling-info-level-logging/34420/3 "2020-05-25T02:21:25Z")

</div>

Globally, this will work, of course:

```julia
using Logging

@info "Show this"
disable_logging(Logging.Info)
@info "Don't show this"

```

But it would be really nice if there was a clean way to do this per-module.

---

<div class="post-metadata">

**Author:** ![dpo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpo/32/3335_2.png) [@dpo](https://discourse.julialang.org/u/dpo)\
**Post date:** [May 25, 2020, 2:48am UTC](https://discourse.julialang.org/t/controlling-info-level-logging/34420/4 "2020-05-25T02:48:50Z")

</div>

I’m not sure I quite understand what you want to achieve. Is this an option for you:

```julia
using Logging

with_logger(Logging.NullLogger()) do
  @info "BLA"
end

```

Instead of `NullLogger()`, you could equivalently create a logger that logs at the level you want.

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [May 25, 2020, 3:18am UTC](https://discourse.julialang.org/t/controlling-info-level-logging/34420/5 "2020-05-25T03:18:15Z")

</div>

Sure, it’s doable by creating a custom logger. I was merely wondering if there was a standard, quick and easy way to set different logging levels for different modules/packages used by an application. Creating a custom logger might not be an enticing solution for the average user. 🙂

I’m aware that there a add-on packages like [LoggingExtras.jl](https://github.com/oxinabox/LoggingExtras.jl) and [MicroLogging.jl](https://github.com/c42f/MicroLogging.jl) that offer more control over logging output.
