-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user facing Logging API and Benchmarks (#2094)
- Loading branch information
1 parent
22d0448
commit a39e8b5
Showing
10 changed files
with
626 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#ifdef ENABLE_LOGS_PREVIEW | ||
|
||
# include "opentelemetry/nostd/unique_ptr.h" | ||
# include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace logs | ||
{ | ||
|
||
/** | ||
* EventId class which acts the Id of the event with an optional name. | ||
*/ | ||
class EventId | ||
{ | ||
public: | ||
EventId(int64_t id, nostd::string_view name) noexcept | ||
{ | ||
id_ = id; | ||
name_ = nostd::unique_ptr<char[]>{new char[name.length() + 1]}; | ||
std::copy(name.begin(), name.end(), name_.get()); | ||
name_.get()[name.length()] = 0; | ||
} | ||
|
||
public: | ||
int64_t id_; | ||
nostd::unique_ptr<char[]> name_; | ||
}; | ||
|
||
} // namespace logs | ||
OPENTELEMETRY_END_NAMESPACE | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.