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() << ")");
isUpdating = false;
status = err;
} else if (responseCode() == 404) {
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
} else {
- SG_LOG(SG_IO, SG_WARN, "request for:" << url() <<
+ SG_LOG(SG_TERRASYNC, SG_WARN, "request for:" << url() <<
" return code " << responseCode());
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
_repo = NULL;
_repo->updateFailed(this, SVNRepository::SVN_ERROR_NOT_FOUND);
_failed = true;
} 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());
_repo->updateFailed(this, SVNRepository::SVN_ERROR_HTTP);
_failed = true;
}
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;
return;
}
void SVNRepoPrivate::propFindFailed(HTTP::Request *req, SVNRepository::ResultCode err)
{
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;
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();
}
if (_local_dir=="")
{
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Cannot start scenery download. Local cache directory is undefined.");
_fail_count++;
_stalled = true;
SGPath path(_local_dir);
if (!path.exists())
{
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Cannot start scenery download. Directory '" << _local_dir <<
"' does not exist. Set correct directory path or create directory folder.");
_fail_count++;
path.append("version");
if (path.exists())
{
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Cannot start scenery download. Directory '" << _local_dir <<
"' contains the base package. Use a separate directory.");
_fail_count++;
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.");
_fail_count++;
_stalled = true;
// not really an alert - but we want to (always) see this message, so user is
// 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. "
<< status
<< "Directory: '" << _local_dir << "'.");
#else
command = buf.str();
#endif
- SG_LOG(SG_TERRAIN,SG_DEBUG, "sync command '" << command << "'");
+ SG_LOG(SG_TERRASYNC,SG_DEBUG, "sync command '" << command << "'");
#ifdef SG_WINDOWS
// tbd: does Windows support "popen"?
if (rc)
{
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Failed to synchronize directory '" << dir << "', " <<
"error code= " << rc);
return false;
{
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;
HTTP::Request_ptr req = ssq;
_http.makeRequest(req);
if (req->readyState() == HTTP::Request::DONE) {
_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 {
- 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 {
- 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()) {
SyncItem::Status cacheStatus = isPathCached(next);
if (cacheStatus != SyncItem::Invalid) {
_cache_hits++;
- SG_LOG(SG_TERRAIN, SG_DEBUG,
+ SG_LOG(SG_TERRASYNC, SG_DEBUG,
"Cache hit for: '" << next._dir << "'");
next._status = cacheStatus;
_freshTiles.push_back(next);
if (isNewDirectory) {
int rc = path.create_dir( 0755 );
if (rc) {
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Cannot create directory '" << path << "', return code = " << rc );
throw sg_exception("Cannot create directory for terrasync", path.str());
}
if (slot.repository->isDoingSync()) {
#if 1
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_TERRAIN, SG_INFO, "HTTP request count:" << _http.hasActiveRequests());
+ SG_LOG(SG_TERRASYNC, SG_INFO, "sync taking a long time:" << slot.currentItem._dir << " taken " << slot.stamp.elapsedMSec());
+ SG_LOG(SG_TERRASYNC, SG_INFO, "HTTP request count:" << _http.hasActiveRequests());
slot.nextWarnTimeout += 10000;
}
#endif
fail(slot.currentItem);
} else {
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");
}
if (slot.isNewDirectory) {
int rc = path.create_dir( 0755 );
if (rc) {
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Cannot create directory '" << path << "', return code = " << rc );
fail(slot.currentItem);
return;
slot.nextWarnTimeout = 20000;
slot.stamp.stamp();
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());
}
}
SyncItem::Status cacheStatus = isPathCached(next);
if (cacheStatus != SyncItem::Invalid) {
_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;
_freshTiles.push_back(next);
_is_dirty = true;
_fail_count++;
failedItem._status = SyncItem::Failed;
_freshTiles.push_back(failedItem);
- SG_LOG(SG_TERRAIN,SG_INFO,
+ SG_LOG(SG_TERRASYNC,SG_INFO,
"Faield to sync'" << failedItem._dir << "'");
_completedTiles[ failedItem._dir ] = now + UpdateInterval::FailedAttempt;
_is_dirty = true;
time_t now = time(0);
_consecutive_errors = 0;
_success_count++;
- SG_LOG(SG_TERRAIN,SG_INFO,
+ SG_LOG(SG_TERRASYNC,SG_INFO,
"Successfully synchronized directory '" << item._dir << "'");
item._status = SyncItem::Updated;
try {
readProperties(_persistentCachePath.str(), cacheRoot);
} 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;
}
_inited(false)
{
_svnThread = new SvnThread();
- _log = new BufferedLogCallback(SG_TERRAIN, SG_INFO);
+ _log = new BufferedLogCallback(SG_TERRASYNC, SG_INFO);
_log->truncateAt(255);
sglog().addCallback(_log);
{
if (_svnThread->_stalled)
{
- SG_LOG(SG_TERRAIN,SG_ALERT,
+ SG_LOG(SG_TERRASYNC,SG_ALERT,
"Automatic scenery download/synchronization stalled. Too many errors.");
}
else
{
// 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.");
}
_stalledNode->setBoolValue(_svnThread->_stalled);