Mayil-AI-Sandbox / loguru-Jan2023

MIT License
0 stars 0 forks source link

Padding formatting is not documented? (hashtag637) #80

Closed vikramsubramanian closed 2 months ago

vikramsubramanian commented 2 months ago

Great library, thanks for making this!

I found [this guide]( where some examples for padding strings are given:

fmt = "{time} | {level: <8} | {name: ^15} | {function: ^15} | {line: >3} | {message}"

However, I don't know what <, ^ and > mean here. It is not explained in the section.

I also cannot find any mention of these symbols in [the API docs](

Would it be possible to add a short explainer there?

vikramsubramanian commented 2 months ago

Oh, I get it now … are these left, center, and right alignment, respectively?

vikramsubramanian commented 2 months ago

This is using the Python built-in formatting rules (same as the str.format(), see this guide for example: [Using % and .format() for great good!](

vikramsubramanian commented 2 months ago

Thanks. I made a PR to make the documentation a bit clearer with respect to that (I searched the API page for "align" or "pad" but was unable to find anything).

vikramsubramanian commented 2 months ago

Fixed by hashtag638.