Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATREQ] extra-flattening #1241

Open
kfsone opened this issue Nov 27, 2024 · 2 comments
Open

[FEATREQ] extra-flattening #1241

kfsone opened this issue Nov 27, 2024 · 2 comments
Labels
enhancement Improvement to an already existing feature

Comments

@kfsone
Copy link

kfsone commented Nov 27, 2024

I'd like to be able to output the extras list in a more human-facing way.

Current:

logger.remove()
logger.add(sys.stderr, format="{time:HH:MM:ss} | {level} | {message} {extra}")

outputs, e.g

23:13:11 | INFO | Testing {}
23:13:11 | INFO | With extras {'somekey': 'somevalue', 'x': 5}

I would rather it output:

23:13:11 | INFO | Testing 
23:13:11 | INFO | With extras somekey=somevalue, x=5

(I have a very non-technical audience and the presence of braces, colons, etc, generally shapes the way they interact with log output - as I've often found, it makes the difference between some users deliberately keep the context information out of their copy; others will assume the line is perfectly self-contained if there's programmer-stuff on it, and not paste context. This becomes increasingly more likely as the users' technical level decreases)

@Delgan Delgan added the enhancement Improvement to an already existing feature label Nov 27, 2024
@Delgan
Copy link
Owner

Delgan commented Nov 27, 2024

Hi @kfsone.

Yes, in a future release I was planning to improve the support for structured logging. In particular, I agree the formatting of extra arguments should be changed.

@trim21
Copy link
Contributor

trim21 commented Nov 27, 2024

related to #1200 I guess?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an already existing feature
Projects
None yet
Development

No branches or pull requests

3 participants