Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions api/include/opentelemetry/logs/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,28 @@ class NoopEventLogger final : public EventLogger
class NoopEventLoggerProvider final : public EventLoggerProvider
{
public:
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4996)
# elif defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
# endif

NoopEventLoggerProvider() : event_logger_{nostd::shared_ptr<EventLogger>(new NoopEventLogger())}
{}

# if defined(_MSC_VER)
# pragma warning(pop)
# elif defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# pragma GCC diagnostic pop
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic pop
# endif

nostd::shared_ptr<EventLogger> CreateEventLogger(
nostd::shared_ptr<Logger> /*delegate_logger*/,
nostd::string_view /*event_domain*/) noexcept override
Expand Down
19 changes: 19 additions & 0 deletions api/include/opentelemetry/logs/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,27 @@ class OPENTELEMETRY_EXPORT Provider
OPENTELEMETRY_API_SINGLETON static nostd::shared_ptr<EventLoggerProvider> &
GetEventProvider() noexcept
{
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4996)
# elif defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
# endif

static nostd::shared_ptr<EventLoggerProvider> provider(new NoopEventLoggerProvider);
return provider;

# if defined(_MSC_VER)
# pragma warning(pop)
# elif defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# pragma GCC diagnostic pop
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic pop
# endif
}
#endif

Expand Down
Loading