3
3
4
4
#include " opentelemetry/exporters/otlp/otlp_http_exporter_factory.h"
5
5
#include " opentelemetry/exporters/otlp/otlp_http_exporter_options.h"
6
+ #include " opentelemetry/sdk/common/global_log_handler.h"
6
7
#include " opentelemetry/sdk/trace/simple_processor_factory.h"
7
8
#include " opentelemetry/sdk/trace/tracer_provider_factory.h"
8
9
#include " opentelemetry/trace/provider.h"
@@ -20,6 +21,8 @@ namespace nostd = opentelemetry::nostd;
20
21
namespace trace_sdk = opentelemetry::sdk::trace;
21
22
namespace otlp = opentelemetry::exporter::otlp;
22
23
24
+ namespace internal_log = opentelemetry::sdk::common::internal_log;
25
+
23
26
namespace
24
27
{
25
28
opentelemetry::exporter::otlp::OtlpHttpExporterOptions opts;
@@ -35,6 +38,15 @@ void InitTracer()
35
38
}
36
39
} // namespace
37
40
41
+ /*
42
+ Usage:
43
+ - example_otlp_http
44
+ - example_otlp_http <URL>
45
+ - example_otlp_http <URL> <DEBUG>
46
+ - example_otlp_http <URL> <DEBUG> <BIN>
47
+ <DEBUG> = yes|no, to turn console debug on or off
48
+ <BIN> = bin, to export in binary format
49
+ */
38
50
int main (int argc, char *argv[])
39
51
{
40
52
if (argc > 1 )
@@ -55,6 +67,12 @@ int main(int argc, char *argv[])
55
67
}
56
68
}
57
69
}
70
+
71
+ if (opts.console_debug )
72
+ {
73
+ internal_log::GlobalLogHandler::SetLogLevel (internal_log::LogLevel::Debug);
74
+ }
75
+
58
76
// Removing this line will leave the default noop TracerProvider in place.
59
77
InitTracer ();
60
78
0 commit comments