log icon indicating copy to clipboard operation
log copied to clipboard

Stabilize kv_unstable

Open KodrAus opened this issue 4 years ago • 9 comments

This is part of #328

I think we've explored enough of this design space now and the API has been in use within the tide project for some time now with their own kv-capable logging macro.

By stabilizing just the backend (non-macro-supported) kv module we can let users depend on this with confidence so that projects like tracing can also utilize it.

Migration path

The kv API will remain an opt-in optional API. All features that currently begin with kv_unstable will be changed to kv. We can keep these old unstable features around for a while if we need.

Any other changes that are needed should be included here.

Steps

  • [ ] Public API review of the kv module
  • [ ] Stabilize sval
  • [ ] Stabilize value-bag
  • [ ] Documentation and examples

cc @yoshuawuyts

KodrAus avatar Jan 08 '21 05:01 KodrAus

I don't know what the plan is for the kv_unstable_std feature, but can that be removed? Surely most users mean to enable kv_unstable_std if std and kv are enabled.

Thomasdezeeuw avatar Jan 08 '21 12:01 Thomasdezeeuw

@Thomasdezeeuw unfortunately it’s a limitation of Cargo features. Since it’s not possible to activate a feature of a dependency when two unrelated features are active we need one that covers them both.

KodrAus avatar Jan 08 '21 12:01 KodrAus

@KodrAus in the code you can use #[cfg(all(feature = "kv", feature = "std"))] in stead of #[cfg(feature = "kv_unstable_std")], removing the kv_unstable_std feature.

Thomasdezeeuw avatar Jan 08 '21 13:01 Thomasdezeeuw

@Thomasdezeeuw we can do that in code, but we also have dependencies that need their own std features enabled too.

KodrAus avatar Jan 08 '21 23:01 KodrAus

@KodrAus could you make another release to try the new macro syntax?

Thomasdezeeuw avatar Dec 04 '21 12:12 Thomasdezeeuw

@Thomasdezeeuw Will do! I'll get the ball rolling on this now.

KodrAus avatar Dec 07 '21 09:12 KodrAus

@KodrAus any update on a release? We've been using the git version without issues for a while (including the new macro syntax).

Thomasdezeeuw avatar Feb 21 '22 11:02 Thomasdezeeuw

@Thomasdezeeuw I've been waiting for some feedback from the wider project on https://github.com/rust-lang/log/issues/343#issuecomment-1002851191, but it's been a bit quiet. I'm pretty confident in the direction we're going though and that we're not heading down a path we'll regret later so will push ahead.

KodrAus avatar Feb 22 '22 22:02 KodrAus

I've opened #485 to get a release out the door. I'm just going to run through the diff, but if you had a chance to take a look too @Thomasdezeeuw that would be much appreciated! :bow:

KodrAus avatar Feb 22 '22 22:02 KodrAus