# Print debug colors

**URL:** <https://forum.dfinity.org/t/print-debug-colors/27052>\
**Category:** Rust\
**Created:** [January 28, 2024, 8:31am UTC](https://forum.dfinity.org/t/print-debug-colors/27052 "2024-01-28T08:31:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [January 28, 2024, 8:31am UTC](https://forum.dfinity.org/t/print-debug-colors/27052/1 "2024-01-28T08:31:33Z")

</div>

I noticed that the CMC prints messages to the terminal in a different color. I’m not sure if it’s because they are warnings or if it’s explicitly yellow, but, nevertheless, is it actually possible to use colors when printing (`ic_cdk::print`) to the local replica logs?

 ![Capture d’écran 2024-01-28 à 09.28.23](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/3/381e001bb9d1804c575e6b4b52be2f1dc0b8b3a4.jpeg)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 29, 2024, 1:44pm UTC](https://forum.dfinity.org/t/print-debug-colors/27052/2 "2024-01-29T13:44:17Z")

</div>

[Here’s](https://github.com/dfinity/ic/blob/master/rs/nns/cmc/src/main.rs#L430-L436) how the CMC defines its `print` function. It uses a terminal color printing crate called `yansi`

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [January 29, 2024, 1:56pm UTC](https://forum.dfinity.org/t/print-debug-colors/27052/3 "2024-01-29T13:56:34Z")

</div>

Nice! Thanks for the tips.
