From 5dd61861d23a58ecc478485d1a684422ab458cca Mon Sep 17 00:00:00 2001 From: Xavrax Date: Thu, 12 Oct 2023 12:09:49 +0200 Subject: [PATCH] much better logging --- core/pubnub_crypto.c | 8 ++++++++ cpp/samples/pubnub_crypto_module_sample.cpp | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/pubnub_crypto.c b/core/pubnub_crypto.c index 0367cc33..9389f346 100644 --- a/core/pubnub_crypto.c +++ b/core/pubnub_crypto.c @@ -796,6 +796,14 @@ static pubnub_bymebl_t provider_encrypt(struct pubnub_crypto_provider_t const* p memcpy(result.ptr + header_size, encrypted_data->data.ptr, encrypted_data->data.size); + #if PUBNUB_LOG_LEVEL >= PUBNUB_LOG_LEVEL_DEBUG + PUBNUB_LOG_DEBUG("\nbytes to decrypt = ["); + for (size_t i = 0; i < result.size; i++) { + PUBNUB_LOG_DEBUG("%d ", result.ptr[i]); + } + PUBNUB_LOG_DEBUG("]\n"); + #endif + free(header_block->ptr); free(header_block); diff --git a/cpp/samples/pubnub_crypto_module_sample.cpp b/cpp/samples/pubnub_crypto_module_sample.cpp index dabbab40..dec8ef51 100644 --- a/cpp/samples/pubnub_crypto_module_sample.cpp +++ b/cpp/samples/pubnub_crypto_module_sample.cpp @@ -88,8 +88,6 @@ int main() return -1; } - std::this_thread::sleep_for(std::chrono::seconds(10)); - if (PNR_OK == pb.subscribe(chan).await()) { auto messages = pb.get_all(); for (auto const& m : messages) {