File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ typedef mapbox::util::variant<bool,
23
23
uint64_t ,
24
24
std::string,
25
25
std::nullptr_t ,
26
+ const char *,
26
27
mapbox::util::recursive_wrapper<Values>,
27
28
mapbox::util::recursive_wrapper<Dictionary>> variant_type;
28
29
@@ -33,6 +34,9 @@ class Value : public variant_type {
33
34
34
35
template <typename T>
35
36
Value (T&& t) : variant_type(t) { }
37
+
38
+ template <int N>
39
+ Value (const char (&cstr)[N]) : variant_type(std::string(cstr)) { }
36
40
};
37
41
38
42
} // namespace lighstep
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ struct KeyValueVisitor {
82
82
83
83
void operator ()(bool b) const { kv->set_bool_value (b); }
84
84
85
+ void operator ()(const char * s) const { kv->set_string_value (s); }
86
+
85
87
void operator ()(const std::string &s) const { kv->set_string_value (s); }
86
88
87
89
// More-or-less unsupported types:
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ int main() {
69
69
auto recorder = tracer.impl ()->recorder ();
70
70
71
71
auto span = lightstep::Tracer::Global ().StartSpan (" span/parent" );
72
+ const char *v = " value" ;
73
+ span.SetTag (" test1" , v);
74
+ span.SetTag (" test2" , " value" );
72
75
span.SetBaggageItem (" test" , " baggage" );
73
76
auto parent = span.context ();
74
77
span.Finish ();
You can’t perform that action at this time.
0 commit comments