Skip to content

Conversion from log::kv::Value to Option<Vec<String>> #535

Description

@lcmgh

Hello!

I am implementing a custom logger that prints a JSON serialized struct. The struct has a field custom_list: Option<Vec<String>> that should be derived from log::kv::Value. However I could not figure out how to convert to Vec<String> from Value? Is that a missing feature or am I overseeing something here?

MyStruct {
   custom_list: Option<Vec<String>>
}

From end users perspective:
info!(custom_list = as_serde!(vec!["a".to_string(), "b".to_string()]); "Test log msg");

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions