#logger #terminal #log #logging #shell #cli-applications #cli


A simple logger for your CLI apps or other things you want in the terminal

30 stable releases

1.5.15 Mar 30, 2023
1.5.13 May 3, 2022
1.5.11 Feb 18, 2022
1.5.8 Dec 8, 2021
1.4.1 Mar 29, 2020

#29 in Command-line interface

Download history 1292/week @ 2024-01-15 968/week @ 2024-01-22 1175/week @ 2024-01-29 1224/week @ 2024-02-05 1328/week @ 2024-02-12 1712/week @ 2024-02-19 1653/week @ 2024-02-26 1869/week @ 2024-03-04 1860/week @ 2024-03-11 1785/week @ 2024-03-18 1938/week @ 2024-03-25 1920/week @ 2024-04-01 2057/week @ 2024-04-08 1743/week @ 2024-04-15 1897/week @ 2024-04-22 1887/week @ 2024-04-29

7,844 downloads per month
Used in 60 crates (21 directly)

MPL-2.0 license



Simple way to output beautiful text in your CLI applications. Only limit is your imagination.

Build status badge Crates io badge Repository version badge License badge


If the provided logging API is too simple for your use case (it's definitely not meant for anything too complex) but you still like the formatting style (<blue></> etc) then you can still make use of this crate! See here for a quick example.

By importing the format module, you get access to the Formatter structure itself. This is what the Logger uses in the back end anyway, you're basically stripping away the API.

For even more ease of use the formatter module includes a colorize_string function which you can use to directly colorize whatever without initializing the formatter. Drawbacks and caveats may apply, read the docs.

See the formatter module for more info if needed.

How to use

paris = "1.5"
use paris::Logger;

let mut log = Logger::new();

log.info("It's that simple!");

Optional features


If you'd like timestamps with all your logs you'll have to enable the feature when adding the crate as a dependency.

paris = { version = "1.5", features = ["timestamps"] }

Every common function has a macro. To make use of these macros you'll need to enable the macros feature.

paris = { version = "1.5", features = ["macros"] }
No logger

If you'd prefer to only use the macros and not even have the Logger struct included in your package, that's definitely possible! All you need to do is enable the no_logger feature.

paris = { version = "1.5", features = ["no_logger"] }

Simple API

// You can have icons at the start of your message!
log.info("Will add ℹ at the start");
log.error("Will add ✖ at the start");

// or as macros
info!("Will add ℹ at the start");
error!("Will add ✖ at the start");
See the Logger struct for all methods and their macro equivalents


All methods can be chained together to build more intricate log/message combinations, in hopes of minimizing the chaos that every log string becomes when you have to concatenate a bunch of strings and add tabs and newlines everywhere.

log.info("this is some info")
   .indent(4).warn("this is now indented by 4")
   .success("and this is 5 lines under all other messages");


Outputting text is cool. Outputting text with a colored icon at the start is even cooler! But this crate is all about customisation, about making the logs feel like home, if you will. Included in the crate are a variety of keys you can use to colorize your logs just the way you want them to be.

log.info("I can write normal text or use tags to <red>color it</>");
log.warn("Every function can contain <on-green><black>tags</>");

log.info("If you don't write them <bleu>correctly</>, you just get an ugly looking tag");

There's a key for all colors supported by the terminal (white, black, red, blue, magenta, etc.) If you add the word on to any of those colors, it becomes the background color instead (on-red, on-blue, on-green).

// How useful...
log.info("<on-red> This has red background</>");

Maybe you'd like to use your terminals brighter colors, if that's the case you just have to add bright to your tag. Makes sense.

log.info("<blue><on-bright-red> This text is blue on a bright red background</> it's a pain");

If you feel like writing a lot of colors by hand is too tedious, or if you know you're going to be using the same combination of colors over and over again you can create a custom style that encapsulates all those colors.

log.add_style("lol", vec!["green", "bold", "on-bright-blue"]);

// '<lol>' is now a key that you can use in your strings
log.info("<lol>This is has all your new styles</>");
Scroll down for a full list of keys if you're not feeling confident in your ability to name colors. It happens.


You've probably seen the </> tag in the above logs. It's not there to "close the previously opened tag" no no. You can open as many tags as you want and only use </> once, it's just the "reset everything to default" tag, You might decide you don't ever want to use it. It's up to you.

However, resetting everything to default might not be what you want. Most of the time it'll be enough, but for those times when it isn't there are a few other tags such as:

  • <///> only resets the background
  • <//> only reset the foreground


With the macros feature enabled, you get access to macro equivalents of the logger functions.

Advantages of using macros:

  • You don't have to instantiate the logger Logger::new()
  • Simple to write
  • Can format parameters like print! and println!

Disadvantages of using macros:

  • Can't chain calls
  • Manual newlines and tabs with \n and \t
  • There's no loading animation for macros

You get to decide whether you want to use macros or not. Every macro has the same functionality as its Logger equivalent. Colors and icon keys work just the same.

See the Logger struct for all methods and their macro equivalents

Color keys

To use a key just add the color name surrounded by <, > to your log string. If you don't like the dashes(-), you can use underlines(_) or spaces( )


black, red, green, yellow, blue, cyan, magenta, white


bright-black, bright-red, bright-green, bright-yellow, bright-blue, bright-cyan, bright-magenta, bright-white


on-black, on-red, on-green, on-yellow, on-blue, on-cyan, on-magenta, on-white


on-bright-black, on-bright-red, on-bright-green, on-bright-yellow, on-bright-blue, on-bright-cyan, on-bright-magenta, on-bright-white


bold(b), underline(u), dimmed(d), italic(i), blink(l), reverse(r), hidden(h), strikethrough(s)

Styles are a bit different, they all have their usual keys, the long and painful to write ones. But they also have shorthand keys (in parenthesis).

And while they all may reset using one of the reset keys above, if you're looking to turn off a specific style you've opened, you can just use the exact same key but with a slash / in front of it.

Example: <bold> gets closed by </bold>


info, cross, warn, tick, heart

No runtime deps