oxidecomputer / oxidecomputer/dropshot

Re-export `slog`

Open Beginner friendly
#1,607 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

In general I think it's a good practice to re-export types from dependencies that are part of a crate's public API. Currently, slog::Logger is part of the public API for ConfigLogging::to_logger and ServerBuilder::new, but is not re-exported from slog. So as a user of dropshot, if I want to make a function that wraps (in my case) ConfigLogging::to_logger, I have to specify slog as a direct dependency of my crate alongside dropshot and ensure I manually keep the versions of <my_crate> > slog synced with <my_crate> > dropshot > slog. It's not impossible, but it is tedious.

It looks like dropshot currently re-exports one dependency: semver. Could the same be done for slog?

Separate, but related: when re-exporting multiple dependent crates, you may want to put them in a module together. I've seen it called deps elsewhere. Your call!

Also, thanks for building dropshot! I'm really enjoying using it so far!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the public exports and the signatures of ConfigLogging::to_logger and ServerBuilder::new, which expose slog::Logger. Check how semver is currently re-exported, then verify that downstream users can refer to the slog types through dropshot without a direct slog dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.