Skip to content

Commit 2da2d0d

Browse files
authored
Remove some usages of internal APIs in samples (#5186)
* Remove some usages of internal APIs in samples * std::cerr => std::cout * Two errors would actually go to stderr --------- Co-authored-by: Anton Kolesnyk <[email protected]>
1 parent fbf5813 commit 2da2d0d

File tree

5 files changed

+6
-23
lines changed

5 files changed

+6
-23
lines changed

samples/integration/vcpkg-all-smoke/src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include <azure/attestation.hpp>
1010
#include <azure/core.hpp>
11-
#include <azure/core/internal/json/json.hpp>
1211
#include <azure/identity.hpp>
1312
#include <azure/keyvault/certificates.hpp>
1413
#include <azure/keyvault/keys.hpp>

sdk/attestation/azure-security-attestation/samples/policy/reset_policy.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
*/
1818

1919
#include <azure/attestation.hpp>
20-
#include <azure/core/base64.hpp>
21-
#include <azure/core/cryptography/hash.hpp>
22-
#include <azure/core/internal/cryptography/sha_hash.hpp>
2320
#include <azure/identity.hpp>
2421

2522
#include <chrono>
@@ -34,7 +31,6 @@ using namespace Azure::Security::Attestation;
3431
using namespace Azure::Security::Attestation::Models;
3532
using namespace std::chrono_literals;
3633
using namespace Azure::Core;
37-
using namespace Azure::Core::Cryptography::_internal;
3834

3935
int main()
4036
{

sdk/attestation/azure-security-attestation/samples/policy/reset_sealed_policy.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#include "cryptohelpers.hpp"
2121

2222
#include <azure/attestation.hpp>
23-
#include <azure/core/base64.hpp>
24-
#include <azure/core/cryptography/hash.hpp>
25-
#include <azure/core/internal/cryptography/sha_hash.hpp>
2623
#include <azure/identity.hpp>
2724

2825
#include <chrono>
@@ -37,7 +34,6 @@ using namespace Azure::Security::Attestation;
3734
using namespace Azure::Security::Attestation::Models;
3835
using namespace std::chrono_literals;
3936
using namespace Azure::Core;
40-
using namespace Azure::Core::Cryptography::_internal;
4137

4238
int main()
4339
{

sdk/attestation/azure-security-attestation/samples/policy/set_policy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <thread>
3030
#include <vector>
3131

32-
// cspell:: words mrsigner mrenclave mitm
32+
// cspell: words mrsigner mitm
3333
using namespace Azure::Security::Attestation;
3434
using namespace Azure::Security::Attestation::Models;
3535
using namespace std::chrono_literals;

sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/consume_events.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111
// Both of these should be available from the Azure portal.
1212
//
1313

14-
#include <azure/core/diagnostics/logger.hpp>
15-
#include <azure/core/internal/diagnostics/log.hpp>
1614
#include <azure/messaging/eventhubs.hpp>
1715

18-
using namespace Azure::Core::Diagnostics;
19-
using namespace Azure::Core::Diagnostics::_internal;
20-
2116
#include <iostream>
2217

2318
int main()
@@ -43,7 +38,6 @@ int main()
4338
// Retrieve properties about the EventHubs instance just created.
4439
auto eventhubProperties{consumerClient.GetEventHubProperties()};
4540
std::cout << "Created event hub, properties: " << eventhubProperties << std::endl;
46-
Log::Stream(Logger::Level::Verbose) << "Created event hub, properties: " << eventhubProperties;
4741

4842
// Retrieve properties about the EventHubs instance just created.
4943
auto partitionProperties{
@@ -57,16 +51,14 @@ int main()
5751
partitionClientOptions.StartPosition.Earliest = true;
5852
partitionClientOptions.StartPosition.Inclusive = true;
5953

60-
Log::Stream(Logger::Level::Verbose)
61-
<< "Creating partition client. Start position: " << partitionClientOptions.StartPosition;
62-
Log::Stream(Logger::Level::Verbose)
63-
<< "Creating partition client. Start position: " << partitionClientOptions.StartPosition;
54+
std::cout << "Creating partition client. Start position: "
55+
<< partitionClientOptions.StartPosition;
6456

65-
Log::Stream(Logger::Level::Verbose) << "earliest: HasValue: " << std::boolalpha
66-
<< partitionClientOptions.StartPosition.Earliest.HasValue();
57+
std::cout << "earliest: HasValue: " << std::boolalpha
58+
<< partitionClientOptions.StartPosition.Earliest.HasValue();
6759
if (partitionClientOptions.StartPosition.Earliest.HasValue())
6860
{
69-
std::cerr << "earliest: Value: " << std::boolalpha
61+
std::cout << "earliest: Value: " << std::boolalpha
7062
<< partitionClientOptions.StartPosition.Earliest.Value() << std::endl;
7163
}
7264

0 commit comments

Comments
 (0)