New log class for terrasync
This commit is contained in:
@@ -32,7 +32,8 @@ typedef enum {
|
|||||||
SG_SOUND = 0x00200000,
|
SG_SOUND = 0x00200000,
|
||||||
SG_NAVAID = 0x00400000,
|
SG_NAVAID = 0x00400000,
|
||||||
SG_GUI = 0x00800000,
|
SG_GUI = 0x00800000,
|
||||||
SG_UNDEFD = 0x01000000, // For range checking
|
SG_TERRASYNC = 0x01000000,
|
||||||
|
SG_UNDEFD = 0x02000000, // For range checking
|
||||||
|
|
||||||
SG_ALL = 0xFFFFFFFF
|
SG_ALL = 0xFFFFFFFF
|
||||||
} sgDebugClass;
|
} sgDebugClass;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ const char* debugClassToString(sgDebugClass c)
|
|||||||
case SG_SOUND: return "sound";
|
case SG_SOUND: return "sound";
|
||||||
case SG_NAVAID: return "navaid";
|
case SG_NAVAID: return "navaid";
|
||||||
case SG_GUI: return "gui";
|
case SG_GUI: return "gui";
|
||||||
|
case SG_TERRASYNC: return "terrasync";
|
||||||
default: return "unknown";
|
default: return "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (tagStack.empty()) {
|
if (tagStack.empty()) {
|
||||||
if (strcmp(name, DAV_MULTISTATUS_TAG)) {
|
if (strcmp(name, DAV_MULTISTATUS_TAG)) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "root element is not " <<
|
SG_LOG(SG_TERRASYNC, SG_WARN, "root element is not " <<
|
||||||
DAV_MULTISTATUS_TAG << ", got:" << name);
|
DAV_MULTISTATUS_TAG << ", got:" << name);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ public:
|
|||||||
// not at the root element
|
// not at the root element
|
||||||
if (tagStack.back() == DAV_MULTISTATUS_TAG) {
|
if (tagStack.back() == DAV_MULTISTATUS_TAG) {
|
||||||
if (strcmp(name, DAV_RESPONSE_TAG)) {
|
if (strcmp(name, DAV_RESPONSE_TAG)) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "multistatus child is not response: saw:"
|
SG_LOG(SG_TERRASYNC, SG_WARN, "multistatus child is not response: saw:"
|
||||||
<< name);
|
<< name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ void DAVMultiStatus::parseXML(const char* data, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!XML_Parse(_d->xmlParser, data, size, false)) {
|
if (!XML_Parse(_d->xmlParser, data, size, false)) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "DAV parse error:" << XML_ErrorString(XML_GetErrorCode(_d->xmlParser))
|
SG_LOG(SG_TERRASYNC, SG_WARN, "DAV parse error:" << XML_ErrorString(XML_GetErrorCode(_d->xmlParser))
|
||||||
<< " at line:" << XML_GetCurrentLineNumber(_d->xmlParser)
|
<< " at line:" << XML_GetCurrentLineNumber(_d->xmlParser)
|
||||||
<< " column " << XML_GetCurrentColumnNumber(_d->xmlParser));
|
<< " column " << XML_GetCurrentColumnNumber(_d->xmlParser));
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ void DAVMultiStatus::finishParse()
|
|||||||
{
|
{
|
||||||
if (_d->parserInited) {
|
if (_d->parserInited) {
|
||||||
if (!XML_Parse(_d->xmlParser, NULL, 0, true)) {
|
if (!XML_Parse(_d->xmlParser, NULL, 0, true)) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "DAV parse error:" << XML_ErrorString(XML_GetErrorCode(_d->xmlParser))
|
SG_LOG(SG_TERRASYNC, SG_WARN, "DAV parse error:" << XML_ErrorString(XML_GetErrorCode(_d->xmlParser))
|
||||||
<< " at line:" << XML_GetCurrentLineNumber(_d->xmlParser)
|
<< " at line:" << XML_GetCurrentLineNumber(_d->xmlParser)
|
||||||
<< " column " << XML_GetCurrentColumnNumber(_d->xmlParser));
|
<< " column " << XML_GetCurrentColumnNumber(_d->xmlParser));
|
||||||
_d->valid = false;
|
_d->valid = false;
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ void SVNDirectory::parseCache()
|
|||||||
LineState lineState = LINESTATE_HREF;
|
LineState lineState = LINESTATE_HREF;
|
||||||
std::ifstream file(p.c_str());
|
std::ifstream file(p.c_str());
|
||||||
if (!file.is_open()) {
|
if (!file.is_open()) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "unable to open cache file for reading:" << p);
|
SG_LOG(SG_TERRASYNC, SG_WARN, "unable to open cache file for reading:" << p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool doneSelf = false;
|
bool doneSelf = false;
|
||||||
|
|
||||||
file.getline(href, 1024);
|
file.getline(href, 1024);
|
||||||
if (strcmp(CACHE_VERSION_4_TOKEN, href)) {
|
if (strcmp(CACHE_VERSION_4_TOKEN, href)) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "invalid cache file [missing header token]:" << p << " '" << href << "'");
|
SG_LOG(SG_TERRASYNC, SG_WARN, "invalid cache file [missing header token]:" << p << " '" << href << "'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ void SVNDirectory::writeCache()
|
|||||||
void SVNDirectory::setBaseUrl(const string& url)
|
void SVNDirectory::setBaseUrl(const string& url)
|
||||||
{
|
{
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
SG_LOG(SG_IO, SG_ALERT, "setting base URL on non-root directory " << url);
|
SG_LOG(SG_TERRASYNC, SG_ALERT, "setting base URL on non-root directory " << url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ void SVNDirectory::deleteChildByName(const std::string& nm)
|
|||||||
Dir d(path);
|
Dir d(path);
|
||||||
bool ok = d.remove(true);
|
bool ok = d.remove(true);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
SG_LOG(SG_NETWORK, SG_ALERT, "SVNDirectory::deleteChildByName: failed to remove dir:"
|
SG_LOG(SG_TERRASYNC, SG_ALERT, "SVNDirectory::deleteChildByName: failed to remove dir:"
|
||||||
<< nm << " at path:\n\t" << path);
|
<< nm << " at path:\n\t" << path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ void SVNDirectory::deleteChildByName(const std::string& nm)
|
|||||||
} else {
|
} else {
|
||||||
bool ok = path.remove();
|
bool ok = path.remove();
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
SG_LOG(SG_NETWORK, SG_ALERT, "SVNDirectory::deleteChildByName: failed to remove path:" << nm
|
SG_LOG(SG_TERRASYNC, SG_ALERT, "SVNDirectory::deleteChildByName: failed to remove path:" << nm
|
||||||
<< " at path:\n\t" << path);
|
<< " at path:\n\t" << path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
void updateFailed(HTTP::Request* req, SVNRepository::ResultCode err)
|
void updateFailed(HTTP::Request* req, SVNRepository::ResultCode err)
|
||||||
{
|
{
|
||||||
SG_LOG(SG_IO, SG_WARN, "SVN: failed to update from:" << req->url()
|
SG_LOG(SG_TERRASYNC, SG_WARN, "SVN: failed to update from:" << req->url()
|
||||||
<< "\n(repository:" << p->baseUrl() << ")");
|
<< "\n(repository:" << p->baseUrl() << ")");
|
||||||
isUpdating = false;
|
isUpdating = false;
|
||||||
status = err;
|
status = err;
|
||||||
@@ -134,7 +134,7 @@ namespace { // anonmouse
|
|||||||
} else if (responseCode() == 404) {
|
} else if (responseCode() == 404) {
|
||||||
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
|
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_IO, SG_WARN, "request for:" << url() <<
|
SG_LOG(SG_TERRASYNC, SG_WARN, "request for:" << url() <<
|
||||||
" return code " << responseCode());
|
" return code " << responseCode());
|
||||||
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
|
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
|
||||||
_repo = NULL;
|
_repo = NULL;
|
||||||
@@ -231,7 +231,7 @@ protected:
|
|||||||
_repo->updateFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
|
_repo->updateFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
|
||||||
_failed = true;
|
_failed = true;
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_IO, SG_WARN, "SVN: request for:" << url() <<
|
SG_LOG(SG_TERRASYNC, SG_WARN, "SVN: request for:" << url() <<
|
||||||
" got HTTP status " << responseCode());
|
" got HTTP status " << responseCode());
|
||||||
_repo->updateFailed(this, SVNRepository::SVN_ERROR_HTTP);
|
_repo->updateFailed(this, SVNRepository::SVN_ERROR_HTTP);
|
||||||
_failed = true;
|
_failed = true;
|
||||||
@@ -331,7 +331,7 @@ void SVNRepository::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_d->targetRevision == rootDir()->cachedRevision()) {
|
if (_d->targetRevision == rootDir()->cachedRevision()) {
|
||||||
SG_LOG(SG_IO, SG_DEBUG, baseUrl() << " in sync at version " << _d->targetRevision);
|
SG_LOG(SG_TERRASYNC, SG_DEBUG, baseUrl() << " in sync at version " << _d->targetRevision);
|
||||||
_d->isUpdating = false;
|
_d->isUpdating = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -375,7 +375,7 @@ void SVNRepoPrivate::propFindComplete(HTTP::Request* req, DAVCollection* c)
|
|||||||
void SVNRepoPrivate::propFindFailed(HTTP::Request *req, SVNRepository::ResultCode err)
|
void SVNRepoPrivate::propFindFailed(HTTP::Request *req, SVNRepository::ResultCode err)
|
||||||
{
|
{
|
||||||
if (err != SVNRepository::SVN_ERROR_NOT_FOUND) {
|
if (err != SVNRepository::SVN_ERROR_NOT_FOUND) {
|
||||||
SG_LOG(SG_IO, SG_WARN, "PropFind failed for:" << req->url());
|
SG_LOG(SG_TERRASYNC, SG_WARN, "PropFind failed for:" << req->url());
|
||||||
}
|
}
|
||||||
|
|
||||||
isUpdating = false;
|
isUpdating = false;
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ protected:
|
|||||||
|
|
||||||
virtual void onFail()
|
virtual void onFail()
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN, SG_ALERT, "Failed to query TerraSync SVN server");
|
SG_LOG(SG_TERRASYNC, SG_ALERT, "Failed to query TerraSync SVN server");
|
||||||
HTTP::Request::onFail();
|
HTTP::Request::onFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ bool SGTerraSync::SvnThread::start()
|
|||||||
|
|
||||||
if (_local_dir=="")
|
if (_local_dir=="")
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot start scenery download. Local cache directory is undefined.");
|
"Cannot start scenery download. Local cache directory is undefined.");
|
||||||
_fail_count++;
|
_fail_count++;
|
||||||
_stalled = true;
|
_stalled = true;
|
||||||
@@ -379,7 +379,7 @@ bool SGTerraSync::SvnThread::start()
|
|||||||
SGPath path(_local_dir);
|
SGPath path(_local_dir);
|
||||||
if (!path.exists())
|
if (!path.exists())
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot start scenery download. Directory '" << _local_dir <<
|
"Cannot start scenery download. Directory '" << _local_dir <<
|
||||||
"' does not exist. Set correct directory path or create directory folder.");
|
"' does not exist. Set correct directory path or create directory folder.");
|
||||||
_fail_count++;
|
_fail_count++;
|
||||||
@@ -390,7 +390,7 @@ bool SGTerraSync::SvnThread::start()
|
|||||||
path.append("version");
|
path.append("version");
|
||||||
if (path.exists())
|
if (path.exists())
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot start scenery download. Directory '" << _local_dir <<
|
"Cannot start scenery download. Directory '" << _local_dir <<
|
||||||
"' contains the base package. Use a separate directory.");
|
"' contains the base package. Use a separate directory.");
|
||||||
_fail_count++;
|
_fail_count++;
|
||||||
@@ -403,7 +403,7 @@ bool SGTerraSync::SvnThread::start()
|
|||||||
|
|
||||||
if ((!_use_svn)&&(_rsync_server==""))
|
if ((!_use_svn)&&(_rsync_server==""))
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot start scenery download. Rsync scenery server is undefined.");
|
"Cannot start scenery download. Rsync scenery server is undefined.");
|
||||||
_fail_count++;
|
_fail_count++;
|
||||||
_stalled = true;
|
_stalled = true;
|
||||||
@@ -435,7 +435,7 @@ bool SGTerraSync::SvnThread::start()
|
|||||||
|
|
||||||
// not really an alert - but we want to (always) see this message, so user is
|
// not really an alert - but we want to (always) see this message, so user is
|
||||||
// aware we're downloading scenery (and using bandwidth).
|
// aware we're downloading scenery (and using bandwidth).
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Starting automatic scenery download/synchronization. "
|
"Starting automatic scenery download/synchronization. "
|
||||||
<< status
|
<< status
|
||||||
<< "Directory: '" << _local_dir << "'.");
|
<< "Directory: '" << _local_dir << "'.");
|
||||||
@@ -475,7 +475,7 @@ bool SGTerraSync::SvnThread::runExternalSyncCommand(const char* dir)
|
|||||||
#else
|
#else
|
||||||
command = buf.str();
|
command = buf.str();
|
||||||
#endif
|
#endif
|
||||||
SG_LOG(SG_TERRAIN,SG_DEBUG, "sync command '" << command << "'");
|
SG_LOG(SG_TERRASYNC,SG_DEBUG, "sync command '" << command << "'");
|
||||||
|
|
||||||
#ifdef SG_WINDOWS
|
#ifdef SG_WINDOWS
|
||||||
// tbd: does Windows support "popen"?
|
// tbd: does Windows support "popen"?
|
||||||
@@ -490,7 +490,7 @@ bool SGTerraSync::SvnThread::runExternalSyncCommand(const char* dir)
|
|||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Failed to synchronize directory '" << dir << "', " <<
|
"Failed to synchronize directory '" << dir << "', " <<
|
||||||
"error code= " << rc);
|
"error code= " << rc);
|
||||||
return false;
|
return false;
|
||||||
@@ -505,7 +505,7 @@ void SGTerraSync::SvnThread::run()
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (_svn_server.empty()) {
|
if (_svn_server.empty()) {
|
||||||
SG_LOG(SG_TERRAIN,SG_INFO, "Querying closest TerraSync server");
|
SG_LOG(SG_TERRASYNC,SG_INFO, "Querying closest TerraSync server");
|
||||||
ServerSelectQuery* ssq = new ServerSelectQuery;
|
ServerSelectQuery* ssq = new ServerSelectQuery;
|
||||||
HTTP::Request_ptr req = ssq;
|
HTTP::Request_ptr req = ssq;
|
||||||
_http.makeRequest(req);
|
_http.makeRequest(req);
|
||||||
@@ -515,12 +515,12 @@ void SGTerraSync::SvnThread::run()
|
|||||||
|
|
||||||
if (req->readyState() == HTTP::Request::DONE) {
|
if (req->readyState() == HTTP::Request::DONE) {
|
||||||
_svn_server = ssq->svnUrl();
|
_svn_server = ssq->svnUrl();
|
||||||
SG_LOG(SG_TERRAIN,SG_INFO, "Closest TerraSync server:" << _svn_server);
|
SG_LOG(SG_TERRASYNC,SG_INFO, "Closest TerraSync server:" << _svn_server);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_TERRAIN,SG_WARN, "Failed to query closest TerraSync server");
|
SG_LOG(SG_TERRASYNC,SG_WARN, "Failed to query closest TerraSync server");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_TERRAIN,SG_INFO, "Explicit: TerraSync server:" << _svn_server);
|
SG_LOG(SG_TERRASYNC,SG_INFO, "Explicit: TerraSync server:" << _svn_server);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_svn_server.empty()) {
|
if (_svn_server.empty()) {
|
||||||
@@ -551,7 +551,7 @@ void SGTerraSync::SvnThread::runExternal()
|
|||||||
SyncItem::Status cacheStatus = isPathCached(next);
|
SyncItem::Status cacheStatus = isPathCached(next);
|
||||||
if (cacheStatus != SyncItem::Invalid) {
|
if (cacheStatus != SyncItem::Invalid) {
|
||||||
_cache_hits++;
|
_cache_hits++;
|
||||||
SG_LOG(SG_TERRAIN, SG_DEBUG,
|
SG_LOG(SG_TERRASYNC, SG_DEBUG,
|
||||||
"Cache hit for: '" << next._dir << "'");
|
"Cache hit for: '" << next._dir << "'");
|
||||||
next._status = cacheStatus;
|
next._status = cacheStatus;
|
||||||
_freshTiles.push_back(next);
|
_freshTiles.push_back(next);
|
||||||
@@ -581,7 +581,7 @@ void SGTerraSync::SvnThread::syncPathExternal(const SyncItem& next)
|
|||||||
if (isNewDirectory) {
|
if (isNewDirectory) {
|
||||||
int rc = path.create_dir( 0755 );
|
int rc = path.create_dir( 0755 );
|
||||||
if (rc) {
|
if (rc) {
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot create directory '" << path << "', return code = " << rc );
|
"Cannot create directory '" << path << "', return code = " << rc );
|
||||||
throw sg_exception("Cannot create directory for terrasync", path.str());
|
throw sg_exception("Cannot create directory for terrasync", path.str());
|
||||||
}
|
}
|
||||||
@@ -606,8 +606,8 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
|
|||||||
if (slot.repository->isDoingSync()) {
|
if (slot.repository->isDoingSync()) {
|
||||||
#if 1
|
#if 1
|
||||||
if (slot.stamp.elapsedMSec() > (int)slot.nextWarnTimeout) {
|
if (slot.stamp.elapsedMSec() > (int)slot.nextWarnTimeout) {
|
||||||
SG_LOG(SG_TERRAIN, SG_INFO, "sync taking a long time:" << slot.currentItem._dir << " taken " << slot.stamp.elapsedMSec());
|
SG_LOG(SG_TERRASYNC, SG_INFO, "sync taking a long time:" << slot.currentItem._dir << " taken " << slot.stamp.elapsedMSec());
|
||||||
SG_LOG(SG_TERRAIN, SG_INFO, "HTTP request count:" << _http.hasActiveRequests());
|
SG_LOG(SG_TERRASYNC, SG_INFO, "HTTP request count:" << _http.hasActiveRequests());
|
||||||
slot.nextWarnTimeout += 10000;
|
slot.nextWarnTimeout += 10000;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -622,7 +622,7 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
|
|||||||
fail(slot.currentItem);
|
fail(slot.currentItem);
|
||||||
} else {
|
} else {
|
||||||
updated(slot.currentItem, slot.isNewDirectory);
|
updated(slot.currentItem, slot.isNewDirectory);
|
||||||
SG_LOG(SG_TERRAIN, SG_DEBUG, "sync of " << slot.repository->baseUrl() << " finished ("
|
SG_LOG(SG_TERRASYNC, SG_DEBUG, "sync of " << slot.repository->baseUrl() << " finished ("
|
||||||
<< slot.stamp.elapsedMSec() << " msec");
|
<< slot.stamp.elapsedMSec() << " msec");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,7 +642,7 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
|
|||||||
if (slot.isNewDirectory) {
|
if (slot.isNewDirectory) {
|
||||||
int rc = path.create_dir( 0755 );
|
int rc = path.create_dir( 0755 );
|
||||||
if (rc) {
|
if (rc) {
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Cannot create directory '" << path << "', return code = " << rc );
|
"Cannot create directory '" << path << "', return code = " << rc );
|
||||||
fail(slot.currentItem);
|
fail(slot.currentItem);
|
||||||
return;
|
return;
|
||||||
@@ -661,7 +661,7 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
|
|||||||
slot.nextWarnTimeout = 20000;
|
slot.nextWarnTimeout = 20000;
|
||||||
slot.stamp.stamp();
|
slot.stamp.stamp();
|
||||||
slot.busy = true;
|
slot.busy = true;
|
||||||
SG_LOG(SG_TERRAIN, SG_INFO, "sync of " << slot.repository->baseUrl() << " started, queue size is " << slot.queue.size());
|
SG_LOG(SG_TERRASYNC, SG_INFO, "sync of " << slot.repository->baseUrl() << " started, queue size is " << slot.queue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@ void SGTerraSync::SvnThread::runInternal()
|
|||||||
SyncItem::Status cacheStatus = isPathCached(next);
|
SyncItem::Status cacheStatus = isPathCached(next);
|
||||||
if (cacheStatus != SyncItem::Invalid) {
|
if (cacheStatus != SyncItem::Invalid) {
|
||||||
_cache_hits++;
|
_cache_hits++;
|
||||||
SG_LOG(SG_TERRAIN, SG_DEBUG, "\nTerraSync Cache hit for: '" << next._dir << "'");
|
SG_LOG(SG_TERRASYNC, SG_DEBUG, "\nTerraSync Cache hit for: '" << next._dir << "'");
|
||||||
next._status = cacheStatus;
|
next._status = cacheStatus;
|
||||||
_freshTiles.push_back(next);
|
_freshTiles.push_back(next);
|
||||||
_is_dirty = true;
|
_is_dirty = true;
|
||||||
@@ -739,7 +739,7 @@ void SGTerraSync::SvnThread::fail(SyncItem failedItem)
|
|||||||
_fail_count++;
|
_fail_count++;
|
||||||
failedItem._status = SyncItem::Failed;
|
failedItem._status = SyncItem::Failed;
|
||||||
_freshTiles.push_back(failedItem);
|
_freshTiles.push_back(failedItem);
|
||||||
SG_LOG(SG_TERRAIN,SG_INFO,
|
SG_LOG(SG_TERRASYNC,SG_INFO,
|
||||||
"Faield to sync'" << failedItem._dir << "'");
|
"Faield to sync'" << failedItem._dir << "'");
|
||||||
_completedTiles[ failedItem._dir ] = now + UpdateInterval::FailedAttempt;
|
_completedTiles[ failedItem._dir ] = now + UpdateInterval::FailedAttempt;
|
||||||
_is_dirty = true;
|
_is_dirty = true;
|
||||||
@@ -765,7 +765,7 @@ void SGTerraSync::SvnThread::updated(SyncItem item, bool isNewDirectory)
|
|||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
_consecutive_errors = 0;
|
_consecutive_errors = 0;
|
||||||
_success_count++;
|
_success_count++;
|
||||||
SG_LOG(SG_TERRAIN,SG_INFO,
|
SG_LOG(SG_TERRASYNC,SG_INFO,
|
||||||
"Successfully synchronized directory '" << item._dir << "'");
|
"Successfully synchronized directory '" << item._dir << "'");
|
||||||
|
|
||||||
item._status = SyncItem::Updated;
|
item._status = SyncItem::Updated;
|
||||||
@@ -791,7 +791,7 @@ void SGTerraSync::SvnThread::initCompletedTilesPersistentCache()
|
|||||||
try {
|
try {
|
||||||
readProperties(_persistentCachePath.str(), cacheRoot);
|
readProperties(_persistentCachePath.str(), cacheRoot);
|
||||||
} catch (sg_exception& e) {
|
} catch (sg_exception& e) {
|
||||||
SG_LOG(SG_TERRAIN, SG_INFO, "corrupted persistent cache, discarding");
|
SG_LOG(SG_TERRASYNC, SG_INFO, "corrupted persistent cache, discarding");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,7 +852,7 @@ SGTerraSync::SGTerraSync() :
|
|||||||
_inited(false)
|
_inited(false)
|
||||||
{
|
{
|
||||||
_svnThread = new SvnThread();
|
_svnThread = new SvnThread();
|
||||||
_log = new BufferedLogCallback(SG_TERRAIN, SG_INFO);
|
_log = new BufferedLogCallback(SG_TERRASYNC, SG_INFO);
|
||||||
_log->truncateAt(255);
|
_log->truncateAt(255);
|
||||||
|
|
||||||
sglog().addCallback(_log);
|
sglog().addCallback(_log);
|
||||||
@@ -977,13 +977,13 @@ void SGTerraSync::update(double)
|
|||||||
{
|
{
|
||||||
if (_svnThread->_stalled)
|
if (_svnThread->_stalled)
|
||||||
{
|
{
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Automatic scenery download/synchronization stalled. Too many errors.");
|
"Automatic scenery download/synchronization stalled. Too many errors.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// not really an alert - just always show this message
|
// not really an alert - just always show this message
|
||||||
SG_LOG(SG_TERRAIN,SG_ALERT,
|
SG_LOG(SG_TERRASYNC,SG_ALERT,
|
||||||
"Automatic scenery download/synchronization has stopped.");
|
"Automatic scenery download/synchronization has stopped.");
|
||||||
}
|
}
|
||||||
_stalledNode->setBoolValue(_svnThread->_stalled);
|
_stalledNode->setBoolValue(_svnThread->_stalled);
|
||||||
|
|||||||
Reference in New Issue
Block a user