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

Request for convenience function #252

Open
aklitzke opened this issue Jan 15, 2020 · 1 comment
Open

Request for convenience function #252

aklitzke opened this issue Jan 15, 2020 · 1 comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. slog-scope crate: slog-scope

Comments

@aklitzke
Copy link

Might be nice to have something like:

use slog_scope::*;
new_scope!("key" => "value", || {
  info!("hi");
});

that is shorthand for:

use slog_scope::*;
with_logger(|logger| {
  scope(logger.new(o!("key" => "value")), || {
    info!("hi")
  });
});
@dpc
Copy link
Collaborator

dpc commented Jan 15, 2020

I'd call it with_keys, but 👍 from me. Submit a PR and it will be there. :)

@Techcable Techcable added C-feature-request Category: A feature request, i.e: not implemented / a PR. slog-scope crate: slog-scope labels Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. slog-scope crate: slog-scope
Projects
None yet
Development

No branches or pull requests

3 participants