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 <antkmsft@users.noreply.github.com>
This commit is contained in:
parent
fbf58139f7
commit
2da2d0d8cc
@ -8,7 +8,6 @@
|
||||
|
||||
#include <azure/attestation.hpp>
|
||||
#include <azure/core.hpp>
|
||||
#include <azure/core/internal/json/json.hpp>
|
||||
#include <azure/identity.hpp>
|
||||
#include <azure/keyvault/certificates.hpp>
|
||||
#include <azure/keyvault/keys.hpp>
|
||||
|
||||
@ -17,9 +17,6 @@
|
||||
*/
|
||||
|
||||
#include <azure/attestation.hpp>
|
||||
#include <azure/core/base64.hpp>
|
||||
#include <azure/core/cryptography/hash.hpp>
|
||||
#include <azure/core/internal/cryptography/sha_hash.hpp>
|
||||
#include <azure/identity.hpp>
|
||||
|
||||
#include <chrono>
|
||||
@ -34,7 +31,6 @@ using namespace Azure::Security::Attestation;
|
||||
using namespace Azure::Security::Attestation::Models;
|
||||
using namespace std::chrono_literals;
|
||||
using namespace Azure::Core;
|
||||
using namespace Azure::Core::Cryptography::_internal;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@ -20,9 +20,6 @@
|
||||
#include "cryptohelpers.hpp"
|
||||
|
||||
#include <azure/attestation.hpp>
|
||||
#include <azure/core/base64.hpp>
|
||||
#include <azure/core/cryptography/hash.hpp>
|
||||
#include <azure/core/internal/cryptography/sha_hash.hpp>
|
||||
#include <azure/identity.hpp>
|
||||
|
||||
#include <chrono>
|
||||
@ -37,7 +34,6 @@ using namespace Azure::Security::Attestation;
|
||||
using namespace Azure::Security::Attestation::Models;
|
||||
using namespace std::chrono_literals;
|
||||
using namespace Azure::Core;
|
||||
using namespace Azure::Core::Cryptography::_internal;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
// cspell:: words mrsigner mrenclave mitm
|
||||
// cspell: words mrsigner mitm
|
||||
using namespace Azure::Security::Attestation;
|
||||
using namespace Azure::Security::Attestation::Models;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
@ -11,13 +11,8 @@
|
||||
// Both of these should be available from the Azure portal.
|
||||
//
|
||||
|
||||
#include <azure/core/diagnostics/logger.hpp>
|
||||
#include <azure/core/internal/diagnostics/log.hpp>
|
||||
#include <azure/messaging/eventhubs.hpp>
|
||||
|
||||
using namespace Azure::Core::Diagnostics;
|
||||
using namespace Azure::Core::Diagnostics::_internal;
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
@ -43,7 +38,6 @@ int main()
|
||||
// Retrieve properties about the EventHubs instance just created.
|
||||
auto eventhubProperties{consumerClient.GetEventHubProperties()};
|
||||
std::cout << "Created event hub, properties: " << eventhubProperties << std::endl;
|
||||
Log::Stream(Logger::Level::Verbose) << "Created event hub, properties: " << eventhubProperties;
|
||||
|
||||
// Retrieve properties about the EventHubs instance just created.
|
||||
auto partitionProperties{
|
||||
@ -57,16 +51,14 @@ int main()
|
||||
partitionClientOptions.StartPosition.Earliest = true;
|
||||
partitionClientOptions.StartPosition.Inclusive = true;
|
||||
|
||||
Log::Stream(Logger::Level::Verbose)
|
||||
<< "Creating partition client. Start position: " << partitionClientOptions.StartPosition;
|
||||
Log::Stream(Logger::Level::Verbose)
|
||||
<< "Creating partition client. Start position: " << partitionClientOptions.StartPosition;
|
||||
std::cout << "Creating partition client. Start position: "
|
||||
<< partitionClientOptions.StartPosition;
|
||||
|
||||
Log::Stream(Logger::Level::Verbose) << "earliest: HasValue: " << std::boolalpha
|
||||
<< partitionClientOptions.StartPosition.Earliest.HasValue();
|
||||
std::cout << "earliest: HasValue: " << std::boolalpha
|
||||
<< partitionClientOptions.StartPosition.Earliest.HasValue();
|
||||
if (partitionClientOptions.StartPosition.Earliest.HasValue())
|
||||
{
|
||||
std::cerr << "earliest: Value: " << std::boolalpha
|
||||
std::cout << "earliest: Value: " << std::boolalpha
|
||||
<< partitionClientOptions.StartPosition.Earliest.Value() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user