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

Is it possible to group logs? #600

Closed
gavrilikhin-d opened this issue Nov 28, 2023 · 2 comments
Closed

Is it possible to group logs? #600

gavrilikhin-d opened this issue Nov 28, 2023 · 2 comments

Comments

@gavrilikhin-d
Copy link

Is it possible to group logs like in js (console.group(), console.groupEnd())?

It's useful to visually create hierarchies of logs, e.g:

Compiling code
|--- Lexing
|--- Parsing
|--- Compiling imported module#1
|      |--- Lexing
|      |--- Parsing
|
| ---Compiling imported module#2
       |--- Lexing
       |--- Parsing
@Thomasdezeeuw
Copy link
Collaborator

We don't provide something exactly like group and groupEnd. However we have some tools you can use to group logs. You can set the target to any string to correlate messages, in additional you have the (Rust source code) module name. You can opt in to the currently unstable (#436) key-values, which allows you to add key-value pair, with which you can add your own group info.

@KodrAus
Copy link
Contributor

KodrAus commented Mar 19, 2024

Structured logging support has been recently stabilized. You can read about it in the docs here.

I'll go ahead and close this one now, but please feel free to open new issues with any new questions you might have!

@KodrAus KodrAus closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants