File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed
Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -605,8 +605,11 @@ be to have versions of the `Error`-returning operations that instead accept a
605605the present state of things is acceptable and that such a change is not
606606warranted.
607607
608- The default implementation of ` Logger ` is ` CerrLogger ` , defined in
609- [ cerr_logger.h] [ 42 ] . ` CerrLogger ` logs to [ std::cerr] [ 43 ] in both ` log_error `
608+ The default implementation of ` Logger ` is ` NullLogger ` , defined in
609+ [ null_logger.h] [ 47 ] . ` NullLogger ` doesn't log anything.
610+
611+ A client library might wish to install ` CerrLogger ` instead. ` CerrLogger ` is
612+ defined in [ cerr_logger.h] [ 42 ] and logs to [ std::cerr] [ 43 ] in both ` log_error `
610613and ` log_startup ` .
611614
612615The ` Logger ` used by a ` Tracer ` is configured via `std::shared_ptr<Logger >
690693[ 39 ] : https://en.cppreference.com/w/cpp/utility/variant/get_if
691694[ 40 ] : https://en.cppreference.com/w/cpp/language/value_category
692695[ 41 ] : ../include/datadog/logger.h
693- [ 42 ] : ../src /datadog/cerr_logger.h
696+ [ 42 ] : ../include /datadog/cerr_logger.h
694697[ 43 ] : https://en.cppreference.com/w/cpp/io/cerr
695698[ 44 ] : https://en.cppreference.com/w/cpp/utility/functional/function
696699[ 45 ] : https://github.com/DataDog/datadog-agent/blob/796ccb9e92326c85b51f519291e86eb5bc950180/pkg/trace/api/endpoints.go#L97
697700[ 46 ] : https://github.com/DataDog/dd-trace-cpp/tree/david.goffredo/traception
701+ [ 47 ] : ../src/datadog/null_logger.h
Original file line number Diff line number Diff line change 33// This component provides a class, `CerrLogger`, that implements the `Logger`
44// interface from `logger.h`. `CerrLogger` prints to `std::cerr`, which is
55// typically an unbuffered stream to the standard error file.
6- //
7- // `CerrLogger` is the default logger used by `Tracer` unless otherwise
8- // configured in `TracerConfig`.
96
107#include < datadog/logger.h>
118
Original file line number Diff line number Diff line change @@ -122,8 +122,8 @@ struct TracerConfig {
122122 Optional<std::size_t > max_tags_header_size;
123123
124124 // `logger` specifies how the tracer will issue diagnostic messages. If
125- // `logger` is null, then it defaults to a logger that inserts into
126- // `std::cerr` .
125+ // `logger` is null, then it defaults to no logging (`NullLogger`). See
126+ // `CerrLogger` for an alternative .
127127 std::shared_ptr<Logger> logger;
128128
129129 // `log_on_startup` indicates whether the tracer will log a banner of
Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ class StreambufGuard {
2929
3030} // namespace
3131
32- // `CerrLogger` is the default logger.
33- // These test exist just to cover all of its methods.
3432TEST_CASE (" CerrLogger" ) {
3533 std::ostringstream stream;
3634 const StreambufGuard guard{std::cerr, stream.rdbuf ()};
You can’t perform that action at this time.
0 commit comments