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

The design of kV is not concise enough, I have a simple suggestion. #604

Closed
jmjoy opened this issue Dec 8, 2023 · 2 comments
Closed

The design of kV is not concise enough, I have a simple suggestion. #604

jmjoy opened this issue Dec 8, 2023 · 2 comments

Comments

@jmjoy
Copy link

jmjoy commented Dec 8, 2023

Just give as_*! add a grammar sugar. For example:

warn!(err = as_error!(err); "Unable to locate a razor, retrying");

also can be written:

warn!(error(err); "Unable to locate a razor, retrying");

For as_debug, as_display and others:

warn!(debug(err); "Unable to locate a razor, retrying");
warn!(display(err); "Unable to locate a razor, retrying");
@Thomasdezeeuw
Copy link
Collaborator

We're considering copying the shorthand of the tracing crate, starting roughly here: #328 (comment). For example log::as_display(value) would be written as ?value. Would something like that work for you?

@jmjoy
Copy link
Author

jmjoy commented Dec 8, 2023

We're considering copying the shorthand of the tracing crate, starting roughly here: #328 (comment). For example log::as_display(value) would be written as ?value. Would something like that work for you?

Very good, thank you. I just saw that the log has a lot of formatting macros, such as serde and sval.

@jmjoy jmjoy closed this as completed Dec 8, 2023
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

2 participants