mirror of https://gitee.com/bigwinds/arangodb
more files using the Logger
This commit is contained in:
parent
ff21453255
commit
00a68113b5
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "Aql/QueryCache.h"
|
#include "Aql/QueryCache.h"
|
||||||
#include "Basics/conversions.h"
|
#include "Basics/conversions.h"
|
||||||
#include "Basics/logging.h"
|
#include "Basics/Logger.h"
|
||||||
#include "Basics/tri-strings.h"
|
#include "Basics/tri-strings.h"
|
||||||
#include "Basics/Exceptions.h"
|
#include "Basics/Exceptions.h"
|
||||||
#include "VocBase/collection.h"
|
#include "VocBase/collection.h"
|
||||||
|
@ -38,9 +38,8 @@
|
||||||
|
|
||||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||||
|
|
||||||
#define LOG_TRX(trx, level, format, ...) \
|
#define LOG_TRX(trx, level) \
|
||||||
LOG_TRACE("trx #%llu.%d (%s): " format, (unsigned long long)trx->_id, \
|
LOG(TRACE) << "trx #" << trx->_id << "." << level << " (" << StatusTransaction(trx->_status) << "): "
|
||||||
(int)level, StatusTransaction(trx->_status), __VA_ARGS__)
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -378,13 +377,11 @@ static int LockCollection(TRI_transaction_collection_t* trxCollection,
|
||||||
|
|
||||||
int res;
|
int res;
|
||||||
if (type == TRI_TRANSACTION_READ) {
|
if (type == TRI_TRANSACTION_READ) {
|
||||||
LOG_TRX(trx, nestingLevel, "read-locking collection %llu",
|
LOG_TRX(trx, nestingLevel) << "read-locking collection " << trxCollection->_cid;
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
res = document->beginReadTimed(timeout,
|
res = document->beginReadTimed(timeout,
|
||||||
TRI_TRANSACTION_DEFAULT_SLEEP_DURATION * 3);
|
TRI_TRANSACTION_DEFAULT_SLEEP_DURATION * 3);
|
||||||
} else {
|
} else {
|
||||||
LOG_TRX(trx, nestingLevel, "write-locking collection %llu",
|
LOG_TRX(trx, nestingLevel) << "write-locking collection " << trxCollection->_cid;
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
res = document->beginWriteTimed(timeout,
|
res = document->beginWriteTimed(timeout,
|
||||||
TRI_TRANSACTION_DEFAULT_SLEEP_DURATION * 3);
|
TRI_TRANSACTION_DEFAULT_SLEEP_DURATION * 3);
|
||||||
}
|
}
|
||||||
|
@ -440,20 +437,16 @@ static int UnlockCollection(TRI_transaction_collection_t* trxCollection,
|
||||||
trxCollection->_lockType == TRI_TRANSACTION_READ) {
|
trxCollection->_lockType == TRI_TRANSACTION_READ) {
|
||||||
// we should never try to write-unlock a collection that we have only
|
// we should never try to write-unlock a collection that we have only
|
||||||
// read-locked
|
// read-locked
|
||||||
LOG_ERROR("logic error in UnlockCollection");
|
LOG(ERROR) << "logic error in UnlockCollection";
|
||||||
TRI_ASSERT(false);
|
TRI_ASSERT(false);
|
||||||
return TRI_ERROR_INTERNAL;
|
return TRI_ERROR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trxCollection->_lockType == TRI_TRANSACTION_READ) {
|
if (trxCollection->_lockType == TRI_TRANSACTION_READ) {
|
||||||
LOG_TRX(trxCollection->_transaction, nestingLevel,
|
LOG_TRX(trxCollection->_transaction, nestingLevel) << "read-unlocking collection " << trxCollection->_cid;
|
||||||
"read-unlocking collection %llu",
|
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
document->endRead();
|
document->endRead();
|
||||||
} else {
|
} else {
|
||||||
LOG_TRX(trxCollection->_transaction, nestingLevel,
|
LOG_TRX(trxCollection->_transaction, nestingLevel) << "write-unlocking collection " << trxCollection->_cid;
|
||||||
"write-unlocking collection %llu",
|
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
document->endWrite();
|
document->endWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,8 +478,7 @@ static int UseCollections(TRI_transaction_t* trx, int nestingLevel) {
|
||||||
!HasHint(trx, TRI_TRANSACTION_HINT_NO_USAGE_LOCK)) {
|
!HasHint(trx, TRI_TRANSACTION_HINT_NO_USAGE_LOCK)) {
|
||||||
// use and usage-lock
|
// use and usage-lock
|
||||||
TRI_vocbase_col_status_e status;
|
TRI_vocbase_col_status_e status;
|
||||||
LOG_TRX(trx, nestingLevel, "using collection %llu",
|
LOG_TRX(trx, nestingLevel) << "using collection " << trxCollection->_cid;
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
trxCollection->_collection = TRI_UseCollectionByIdVocBase(
|
trxCollection->_collection = TRI_UseCollectionByIdVocBase(
|
||||||
trx->_vocbase, trxCollection->_cid, status);
|
trx->_vocbase, trxCollection->_cid, status);
|
||||||
} else {
|
} else {
|
||||||
|
@ -616,8 +608,7 @@ static int ReleaseCollections(TRI_transaction_t* trx, int nestingLevel) {
|
||||||
// the top level transaction releases all collections
|
// the top level transaction releases all collections
|
||||||
if (trxCollection->_collection != nullptr) {
|
if (trxCollection->_collection != nullptr) {
|
||||||
// unuse collection, remove usage-lock
|
// unuse collection, remove usage-lock
|
||||||
LOG_TRX(trx, nestingLevel, "unusing collection %llu",
|
LOG_TRX(trx, nestingLevel) << "unusing collection " << trxCollection->_cid;
|
||||||
(unsigned long long)trxCollection->_cid);
|
|
||||||
|
|
||||||
TRI_ReleaseCollectionVocBase(trx->_vocbase, trxCollection->_collection);
|
TRI_ReleaseCollectionVocBase(trx->_vocbase, trxCollection->_collection);
|
||||||
trxCollection->_collection = nullptr;
|
trxCollection->_collection = nullptr;
|
||||||
|
@ -660,8 +651,7 @@ static int WriteBeginMarker(TRI_transaction_t* trx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
LOG_WARNING("could not save transaction begin marker in log: %s",
|
LOG(WARNING) << "could not save transaction begin marker in log: " << TRI_errno_string(res);
|
||||||
TRI_errno_string(res));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -696,8 +686,7 @@ static int WriteAbortMarker(TRI_transaction_t* trx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
LOG_WARNING("could not save transaction abort marker in log: %s",
|
LOG(WARNING) << "could not save transaction abort marker in log: " << TRI_errno_string(res);
|
||||||
TRI_errno_string(res));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -728,8 +717,7 @@ static int WriteCommitMarker(TRI_transaction_t* trx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
LOG_WARNING("could not save transaction commit marker in log: %s",
|
LOG(WARNING) << "could not save transaction commit marker in log: " << TRI_errno_string(res);
|
||||||
TRI_errno_string(res));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -902,7 +890,7 @@ int TRI_AddCollectionTransaction(TRI_transaction_t* trx, TRI_voc_cid_t cid,
|
||||||
TRI_transaction_type_e accessType,
|
TRI_transaction_type_e accessType,
|
||||||
int nestingLevel, bool force,
|
int nestingLevel, bool force,
|
||||||
bool allowImplicitCollections) {
|
bool allowImplicitCollections) {
|
||||||
LOG_TRX(trx, nestingLevel, "adding collection %llu", (unsigned long long)cid);
|
LOG_TRX(trx, nestingLevel) << "adding collection " << cid;
|
||||||
|
|
||||||
// upgrade transaction type if required
|
// upgrade transaction type if required
|
||||||
if (nestingLevel == 0) {
|
if (nestingLevel == 0) {
|
||||||
|
@ -1038,7 +1026,7 @@ bool TRI_IsLockedCollectionTransaction(
|
||||||
if (accessType == TRI_TRANSACTION_WRITE &&
|
if (accessType == TRI_TRANSACTION_WRITE &&
|
||||||
trxCollection->_accessType != TRI_TRANSACTION_WRITE) {
|
trxCollection->_accessType != TRI_TRANSACTION_WRITE) {
|
||||||
// wrong lock type
|
// wrong lock type
|
||||||
LOG_WARNING("logic error. checking wrong lock type");
|
LOG(WARNING) << "logic error. checking wrong lock type";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,8 +1265,7 @@ int TRI_AddOperationTransaction(TRI_transaction_t* trx,
|
||||||
|
|
||||||
int TRI_BeginTransaction(TRI_transaction_t* trx, TRI_transaction_hint_t hints,
|
int TRI_BeginTransaction(TRI_transaction_t* trx, TRI_transaction_hint_t hints,
|
||||||
int nestingLevel) {
|
int nestingLevel) {
|
||||||
LOG_TRX(trx, nestingLevel, "%s %s transaction", "beginning",
|
LOG_TRX(trx, nestingLevel) << "beginning " << (trx->_type == TRI_TRANSACTION_READ ? "read" : "write") << " transaction";
|
||||||
(trx->_type == TRI_TRANSACTION_READ ? "read" : "write"));
|
|
||||||
|
|
||||||
if (nestingLevel == 0) {
|
if (nestingLevel == 0) {
|
||||||
TRI_ASSERT(trx->_status == TRI_TRANSACTION_CREATED);
|
TRI_ASSERT(trx->_status == TRI_TRANSACTION_CREATED);
|
||||||
|
@ -1346,8 +1333,7 @@ int TRI_BeginTransaction(TRI_transaction_t* trx, TRI_transaction_hint_t hints,
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int TRI_CommitTransaction(TRI_transaction_t* trx, int nestingLevel) {
|
int TRI_CommitTransaction(TRI_transaction_t* trx, int nestingLevel) {
|
||||||
LOG_TRX(trx, nestingLevel, "%s %s transaction", "committing",
|
LOG_TRX(trx, nestingLevel) << "committing " << (trx->_type == TRI_TRANSACTION_READ ? "read" : "write") << " transaction";
|
||||||
(trx->_type == TRI_TRANSACTION_READ ? "read" : "write"));
|
|
||||||
|
|
||||||
TRI_ASSERT(trx->_status == TRI_TRANSACTION_RUNNING);
|
TRI_ASSERT(trx->_status == TRI_TRANSACTION_RUNNING);
|
||||||
|
|
||||||
|
@ -1384,8 +1370,7 @@ int TRI_CommitTransaction(TRI_transaction_t* trx, int nestingLevel) {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int TRI_AbortTransaction(TRI_transaction_t* trx, int nestingLevel) {
|
int TRI_AbortTransaction(TRI_transaction_t* trx, int nestingLevel) {
|
||||||
LOG_TRX(trx, nestingLevel, "%s %s transaction", "aborting",
|
LOG_TRX(trx, nestingLevel) << "aborting " << (trx->_type == TRI_TRANSACTION_READ ? "read" : "write") << " transaction";
|
||||||
(trx->_type == TRI_TRANSACTION_READ ? "read" : "write"));
|
|
||||||
|
|
||||||
TRI_ASSERT(trx->_status == TRI_TRANSACTION_RUNNING);
|
TRI_ASSERT(trx->_status == TRI_TRANSACTION_RUNNING);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "ArangoClient.h"
|
#include "ArangoClient.h"
|
||||||
|
|
||||||
#include "Basics/files.h"
|
#include "Basics/files.h"
|
||||||
#include "Basics/logging.h"
|
#include "Basics/Logger.h"
|
||||||
#include "Basics/messages.h"
|
#include "Basics/messages.h"
|
||||||
#include "Basics/tri-strings.h"
|
#include "Basics/tri-strings.h"
|
||||||
#include "Basics/terminal-utils.h"
|
#include "Basics/terminal-utils.h"
|
||||||
|
@ -304,7 +304,7 @@ void ArangoClient::parse(ProgramOptions& options,
|
||||||
|
|
||||||
if (!_configFile.empty()) {
|
if (!_configFile.empty()) {
|
||||||
if (StringUtils::tolower(_configFile) == std::string("none")) {
|
if (StringUtils::tolower(_configFile) == std::string("none")) {
|
||||||
LOG_DEBUG("using no init file at all");
|
LOG(DEBUG) << "using no init file at all";
|
||||||
} else {
|
} else {
|
||||||
configFile = _configFile;
|
configFile = _configFile;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ void ArangoClient::parse(ProgramOptions& options,
|
||||||
configFile = sysDir;
|
configFile = sysDir;
|
||||||
allowLocal = true;
|
allowLocal = true;
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("no system init file '%s'", sysDir.c_str());
|
LOG(DEBUG) << "no system init file '" << sysDir.c_str() << "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ void ArangoClient::parse(ProgramOptions& options,
|
||||||
std::string localConfigFile = configFile + ".local";
|
std::string localConfigFile = configFile + ".local";
|
||||||
|
|
||||||
if (FileUtils::exists(localConfigFile)) {
|
if (FileUtils::exists(localConfigFile)) {
|
||||||
LOG_DEBUG("using init override file '%s'", localConfigFile.c_str());
|
LOG(DEBUG) << "using init override file '" << localConfigFile.c_str() << "'";
|
||||||
|
|
||||||
if (!options.parse(description, localConfigFile)) {
|
if (!options.parse(description, localConfigFile)) {
|
||||||
LOG_FATAL_AND_EXIT("cannot parse config file '%s': %s",
|
LOG_FATAL_AND_EXIT("cannot parse config file '%s': %s",
|
||||||
|
@ -341,7 +341,7 @@ void ArangoClient::parse(ProgramOptions& options,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("using init file '%s'", configFile.c_str());
|
LOG(DEBUG) << "using init file '" << configFile.c_str() << "'";
|
||||||
|
|
||||||
if (!options.parse(description, configFile)) {
|
if (!options.parse(description, configFile)) {
|
||||||
LOG_FATAL_AND_EXIT("cannot parse config file '%s': %s",
|
LOG_FATAL_AND_EXIT("cannot parse config file '%s': %s",
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "Basics/ConditionLocker.h"
|
#include "Basics/ConditionLocker.h"
|
||||||
#include "Basics/ConditionVariable.h"
|
#include "Basics/ConditionVariable.h"
|
||||||
#include "Basics/hashes.h"
|
#include "Basics/hashes.h"
|
||||||
#include "Basics/logging.h"
|
#include "Basics/Logger.h"
|
||||||
#include "Basics/Thread.h"
|
#include "Basics/Thread.h"
|
||||||
#include "Benchmark/BenchmarkCounter.h"
|
#include "Benchmark/BenchmarkCounter.h"
|
||||||
#include "Benchmark/BenchmarkOperation.h"
|
#include "Benchmark/BenchmarkOperation.h"
|
||||||
|
@ -240,7 +240,7 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
const rest::HttpRequest::HttpRequestType type =
|
const rest::HttpRequest::HttpRequestType type =
|
||||||
_operation->type(_threadNumber, threadCounter, globalCounter);
|
_operation->type(_threadNumber, threadCounter, globalCounter);
|
||||||
if (url.empty()) {
|
if (url.empty()) {
|
||||||
LOG_WARNING("URL is empty!");
|
LOG(WARNING) << "URL is empty!";
|
||||||
}
|
}
|
||||||
|
|
||||||
// headline, e.g. POST /... HTTP/1.1
|
// headline, e.g. POST /... HTTP/1.1
|
||||||
|
@ -283,7 +283,7 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
}
|
}
|
||||||
_warningCount++;
|
_warningCount++;
|
||||||
if (_warningCount < MaxWarnings) {
|
if (_warningCount < MaxWarnings) {
|
||||||
LOG_WARNING("batch operation failed because server did not reply");
|
LOG(WARNING) << "batch operation failed because server did not reply";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -293,16 +293,13 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
|
|
||||||
_warningCount++;
|
_warningCount++;
|
||||||
if (_warningCount < MaxWarnings) {
|
if (_warningCount < MaxWarnings) {
|
||||||
LOG_WARNING("batch operation failed with HTTP code %d - %s ",
|
LOG(WARNING) << "batch operation failed with HTTP code " << result->getHttpReturnCode() << " - " << result->getHttpReturnMessage().c_str() << " ";
|
||||||
(int)result->getHttpReturnCode(),
|
|
||||||
result->getHttpReturnMessage().c_str());
|
|
||||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||||
LOG_WARNING("We tried to send this size:\n %llu",
|
LOG(WARNING) << "We tried to send this size:\n " << batchPayload.length();
|
||||||
(unsigned long long)batchPayload.length());
|
LOG(WARNING) << "We tried to send this:\n " << batchPayload.c_str();
|
||||||
LOG_WARNING("We tried to send this:\n %s", batchPayload.c_str());
|
|
||||||
#endif
|
#endif
|
||||||
} else if (_warningCount == MaxWarnings) {
|
} else if (_warningCount == MaxWarnings) {
|
||||||
LOG_WARNING("...more warnings...");
|
LOG(WARNING) << "...more warnings...";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto const& headers = result->getHeaderFields();
|
auto const& headers = result->getHeaderFields();
|
||||||
|
@ -315,13 +312,12 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
_operationsCounter->incFailures(errorCount);
|
_operationsCounter->incFailures(errorCount);
|
||||||
_warningCount++;
|
_warningCount++;
|
||||||
if (_warningCount < MaxWarnings) {
|
if (_warningCount < MaxWarnings) {
|
||||||
LOG_WARNING("Server side warning count: %u", errorCount);
|
LOG(WARNING) << "Server side warning count: " << errorCount;
|
||||||
if (_verbose) {
|
if (_verbose) {
|
||||||
LOG_WARNING("Server reply: %s", result->getBody().c_str());
|
LOG(WARNING) << "Server reply: " << result->getBody().c_str();
|
||||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||||
LOG_WARNING("We tried to send this size:\n %llu",
|
LOG(WARNING) << "We tried to send this size:\n " << batchPayload.length();
|
||||||
(unsigned long long)batchPayload.length());
|
LOG(WARNING) << "We tried to send this:\n " << batchPayload.c_str();
|
||||||
LOG_WARNING("We tried to send this:\n %s", batchPayload.c_str());
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,7 +363,7 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
}
|
}
|
||||||
_warningCount++;
|
_warningCount++;
|
||||||
if (_warningCount < MaxWarnings) {
|
if (_warningCount < MaxWarnings) {
|
||||||
LOG_WARNING("batch operation failed because server did not reply");
|
LOG(WARNING) << "batch operation failed because server did not reply";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -377,10 +373,9 @@ class BenchmarkThread : public arangodb::basics::Thread {
|
||||||
|
|
||||||
_warningCount++;
|
_warningCount++;
|
||||||
if (_warningCount < MaxWarnings) {
|
if (_warningCount < MaxWarnings) {
|
||||||
LOG_WARNING("request for URL '%s' failed with HTTP code %d",
|
LOG(WARNING) << "request for URL '" << url.c_str() << "' failed with HTTP code " << result->getHttpReturnCode();
|
||||||
url.c_str(), (int)result->getHttpReturnCode());
|
|
||||||
} else if (_warningCount == MaxWarnings) {
|
} else if (_warningCount == MaxWarnings) {
|
||||||
LOG_WARNING("...more warnings...");
|
LOG(WARNING) << "...more warnings...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete result;
|
delete result;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "Basics/ProgramOptionsDescription.h"
|
#include "Basics/ProgramOptionsDescription.h"
|
||||||
#include "Basics/StringUtils.h"
|
#include "Basics/StringUtils.h"
|
||||||
#include "Basics/init.h"
|
#include "Basics/init.h"
|
||||||
#include "Basics/logging.h"
|
#include "Basics/Logger.h"
|
||||||
#include "Basics/random.h"
|
#include "Basics/random.h"
|
||||||
#include "Basics/StringBuffer.h"
|
#include "Basics/StringBuffer.h"
|
||||||
#include "Basics/tri-strings.h"
|
#include "Basics/tri-strings.h"
|
||||||
|
@ -376,7 +376,7 @@ int main(int argc, char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Progress && numOperations >= nextReportValue) {
|
if (Progress && numOperations >= nextReportValue) {
|
||||||
LOG_INFO("number of operations: %d", (int)nextReportValue);
|
LOG(INFO) << "number of operations: " << nextReportValue;
|
||||||
nextReportValue += stepValue;
|
nextReportValue += stepValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "Basics/StringUtils.h"
|
#include "Basics/StringUtils.h"
|
||||||
#include "Basics/files.h"
|
#include "Basics/files.h"
|
||||||
|
#include "Basics/Logger.h"
|
||||||
#include "Basics/tri-strings.h"
|
#include "Basics/tri-strings.h"
|
||||||
#include "Basics/VelocyPackHelper.h"
|
#include "Basics/VelocyPackHelper.h"
|
||||||
#include "Rest/HttpRequest.h"
|
#include "Rest/HttpRequest.h"
|
||||||
|
@ -413,15 +414,14 @@ void ImportHelper::reportProgress(int64_t totalLength, int64_t totalRead,
|
||||||
static int64_t nextProcessed = 10 * 1000 * 1000;
|
static int64_t nextProcessed = 10 * 1000 * 1000;
|
||||||
|
|
||||||
if (totalRead >= nextProcessed) {
|
if (totalRead >= nextProcessed) {
|
||||||
LOG_INFO("processed %lld bytes of input file", (long long)totalRead);
|
LOG(INFO) << "processed " << (long long)totalRead << " bytes of input file";
|
||||||
nextProcessed += 10 * 1000 * 1000;
|
nextProcessed += 10 * 1000 * 1000;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
double pct = 100.0 * ((double)totalRead / (double)totalLength);
|
double pct = 100.0 * ((double)totalRead / (double)totalLength);
|
||||||
|
|
||||||
if (pct >= nextProgress && totalLength >= 1024) {
|
if (pct >= nextProgress && totalLength >= 1024) {
|
||||||
LOG_INFO("processed %lld bytes (%0.1f%%) of input file",
|
LOG(INFO) << "processed " << totalRead << " bytes (" << (int) nextProgress << "%) of input file";
|
||||||
(long long)totalRead, nextProgress);
|
|
||||||
nextProgress = (double)((int)(pct + ProgressStep));
|
nextProgress = (double)((int)(pct + ProgressStep));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -677,7 +677,7 @@ void ImportHelper::handleResult(SimpleHttpResult* result) {
|
||||||
if (details.isArray()) {
|
if (details.isArray()) {
|
||||||
for (VPackSlice const& detail : VPackArrayIterator(details)) {
|
for (VPackSlice const& detail : VPackArrayIterator(details)) {
|
||||||
if (detail.isString()) {
|
if (detail.isString()) {
|
||||||
LOG_WARNING("%s", detail.copyString().c_str());
|
LOG(WARNING) << "" << detail.copyString().c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2296,7 +2296,7 @@ static int WarmupEnvironment(v8::Isolate* isolate,
|
||||||
"no 'javascript.startup-directory' has been supplied, giving up");
|
"no 'javascript.startup-directory' has been supplied, giving up");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("using JavaScript startup files at '%s'", StartupPath.c_str());
|
LOG(DEBUG) << "using JavaScript startup files at '" << StartupPath.c_str() << "'";
|
||||||
StartupLoader.setDirectory(StartupPath);
|
StartupLoader.setDirectory(StartupPath);
|
||||||
|
|
||||||
// load all init files
|
// load all init files
|
||||||
|
@ -2329,7 +2329,7 @@ static int WarmupEnvironment(v8::Isolate* isolate,
|
||||||
for (size_t i = 0; i < files.size(); ++i) {
|
for (size_t i = 0; i < files.size(); ++i) {
|
||||||
switch (StartupLoader.loadScript(isolate, context, files[i])) {
|
switch (StartupLoader.loadScript(isolate, context, files[i])) {
|
||||||
case JSLoader::eSuccess:
|
case JSLoader::eSuccess:
|
||||||
LOG_TRACE("loaded JavaScript file '%s'", files[i].c_str());
|
LOG(TRACE) << "loaded JavaScript file '" << files[i].c_str() << "'";
|
||||||
break;
|
break;
|
||||||
case JSLoader::eFailLoad:
|
case JSLoader::eFailLoad:
|
||||||
LOG_FATAL_AND_EXIT("cannot load JavaScript file '%s'",
|
LOG_FATAL_AND_EXIT("cannot load JavaScript file '%s'",
|
||||||
|
@ -2568,11 +2568,10 @@ int main(int argc, char* args[]) {
|
||||||
try {
|
try {
|
||||||
ret = Run(isolate, runMode, promptError);
|
ret = Run(isolate, runMode, promptError);
|
||||||
} catch (std::bad_alloc const&) {
|
} catch (std::bad_alloc const&) {
|
||||||
LOG_ERROR("caught exception %s",
|
LOG(ERROR) << "caught exception " << TRI_errno_string(TRI_ERROR_OUT_OF_MEMORY);
|
||||||
TRI_errno_string(TRI_ERROR_OUT_OF_MEMORY));
|
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
LOG_ERROR("caught unknown exception");
|
LOG(ERROR) << "caught unknown exception";
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2580,9 +2579,9 @@ int main(int argc, char* args[]) {
|
||||||
isolate->LowMemoryNotification();
|
isolate->LowMemoryNotification();
|
||||||
|
|
||||||
// spend at least 3 seconds in GC
|
// spend at least 3 seconds in GC
|
||||||
LOG_DEBUG("entering final garbage collection");
|
LOG(DEBUG) << "entering final garbage collection";
|
||||||
TRI_RunGarbageCollectionV8(isolate, 3000);
|
TRI_RunGarbageCollectionV8(isolate, 3000);
|
||||||
LOG_DEBUG("final garbage collection completed");
|
LOG(DEBUG) << "final garbage collection completed";
|
||||||
|
|
||||||
localContext->Exit();
|
localContext->Exit();
|
||||||
context.Reset();
|
context.Reset();
|
||||||
|
|
Loading…
Reference in New Issue