# Redirecting stdout to avoid banners while \`import\`ing

**URL:** <https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633>\
**Category:** General Usage\
**Created:** [April 15, 2020, 10:56am UTC](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633 "2020-04-15T10:56:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [April 15, 2020, 12:11pm UTC](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633/2 "2020-04-15T12:11:53Z")

</div>

> [@abulak](#):
>
> Any idea why and how to make it so?

The reason why is that this code is not run when the module is loaded from a precompiled file. The way precompilation of packages work is to deserialize the state of the module to a file during precompilation and when loading, the state is simply deserialized and then the ` __init__ ` function of the module is run. No top-level code is run when the module is loaded.

I’m not really sure how to “hook” into the ` __init__ ` function of dependent packages though.

Unconditional printing of banners and such on package load is really user-hostile behavior…

---

_[View the full topic](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633)._
