@@ -182,7 +182,7 @@ void Countly::setDeviceID(const std::string& value, bool same_user) {
182182
183183void Countly::start (const std::string& app_key, const std::string& host, int port, bool start_thread) {
184184 mutex.lock ();
185- log (Countly::LogLevel::DEBUG , " [Countly][start]" );
185+ log (Countly::LogLevel::INFO , " [Countly][start]" );
186186 this ->host = host;
187187 if (host.find (" http://" ) == 0 ) {
188188 use_https = false ;
@@ -370,7 +370,7 @@ void Countly::flushEvents(std::chrono::seconds timeout) {
370370
371371bool Countly::beginSession () {
372372 mutex.lock ();
373- log (Countly::LogLevel::DEBUG , " [Countly][beginSession]" );
373+ log (Countly::LogLevel::INFO , " [Countly][beginSession]" );
374374 if (began_session) {
375375 mutex.unlock ();
376376 return true ;
@@ -410,7 +410,7 @@ bool Countly::beginSession() {
410410}
411411
412412bool Countly::updateSession () {
413- log (Countly::LogLevel::DEBUG , " [Countly][updateSession]" );
413+ log (Countly::LogLevel::INFO , " [Countly][updateSession]" );
414414
415415 mutex.lock ();
416416 if (!began_session) {
@@ -490,7 +490,8 @@ bool Countly::updateSession() {
490490 mutex.unlock ();
491491 return false ;
492492 }
493- last_sent = Countly::getTimestamp ();
493+
494+ last_sent += duration;
494495 }
495496
496497 mutex.unlock ();
@@ -509,7 +510,7 @@ bool Countly::updateSession() {
509510 return false ;
510511 }
511512
512- last_sent = Countly::getTimestamp () ;
513+ last_sent += duration ;
513514
514515#ifndef COUNTLY_USE_SQLITE
515516 event_queue.clear ();
@@ -534,7 +535,7 @@ bool Countly::updateSession() {
534535}
535536
536537bool Countly::endSession () {
537- log (Countly::LogLevel::DEBUG , " [Countly][endSession]" );
538+ log (Countly::LogLevel::INFO , " [Countly][endSession]" );
538539 const std::chrono::system_clock::time_point now = Countly::getTimestamp ();
539540 const auto timestamp = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch ());
540541 const auto duration = std::chrono::duration_cast<std::chrono::seconds>(getSessionDuration (now));
@@ -631,7 +632,7 @@ static size_t countly_curl_write_callback(void *data, size_t byte_size, size_t n
631632Countly::HTTPResponse Countly::sendHTTP (std::string path, std::string data) {
632633 bool use_post = always_use_post || (data.size () > COUNTLY_POST_THRESHOLD);
633634
634- log (Countly::LogLevel::INFO , " [Countly][sendHTTP] data: " + data);
635+ log (Countly::LogLevel::DEBUG , " [Countly][sendHTTP] data: " + data);
635636 if (!salt.empty ()) {
636637 unsigned char checksum[SHA256_DIGEST_LENGTH];
637638 std::string salted_data = data + salt;
@@ -768,7 +769,7 @@ log(Countly::LogLevel::INFO, "[Countly][sendHTTP] data: "+ data);
768769 curl_easy_setopt (curl, CURLOPT_POSTFIELDS, data.c_str ());
769770 }
770771
771- log (Countly::LogLevel::INFO , " [Countly][sendHTTP] request: " + full_url_stream.str ());
772+ log (Countly::LogLevel::DEBUG , " [Countly][sendHTTP] request: " + full_url_stream.str ());
772773
773774 std::string full_url = full_url_stream.str ();
774775 curl_easy_setopt (curl, CURLOPT_URL, full_url.c_str ());
@@ -790,7 +791,7 @@ log(Countly::LogLevel::INFO, "[Countly][sendHTTP] data: "+ data);
790791 curl_easy_cleanup (curl);
791792 }
792793#endif
793- log (Countly::LogLevel::INFO , " [Countly][sendHTTP] response: " + response.data .dump ());
794+ log (Countly::LogLevel::DEBUG , " [Countly][sendHTTP] response: " + response.data .dump ());
794795 return response;
795796#endif
796797
@@ -808,7 +809,7 @@ std::chrono::system_clock::duration Countly::getSessionDuration() {
808809}
809810
810811void Countly::updateLoop () {
811- log (Countly::LogLevel::INFO , " [Countly][updateLoop]" );
812+ log (Countly::LogLevel::DEBUG , " [Countly][updateLoop]" );
812813 mutex.lock ();
813814 running = true ;
814815 mutex.unlock ();
0 commit comments