* Add more status information when an oar is being saved

* Among other messages, a log entry is posted for every 50 assets added to the archive
0.6.4-rc1
Justin Clarke Casey 2009-03-05 21:36:48 +00:00
parent 3ad2fef2d3
commit ff7b20bef1
2 changed files with 23 additions and 0 deletions

View File

@ -90,11 +90,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Write out control file
archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile());
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
// Write out region settings
string settingsPath
= String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName);
archive.AddFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings));
m_log.InfoFormat("[ARCHIVER]: Added region settings to archive.");
// Write out terrain
string terrainPath
= String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_scene.RegionInfo.RegionName);
@ -104,6 +108,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
archive.AddFile(terrainPath, ms.ToArray());
ms.Close();
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
// Write out scene object metadata
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
{
@ -122,6 +128,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
archive.AddFile(filename, serializedObject);
}
m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
// Write out assets
AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound);
assetsArchiver.Archive(archive);

View File

@ -42,6 +42,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <value>
/// Post a message to the log every x assets as a progress bar
/// </value>
private static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 50;
/// <summary>
/// Archive assets
/// </summary>
@ -117,6 +122,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// It appears that gtar, at least, doesn't need the intermediate directory entries in the tar
//archive.AddDir("assets");
int assetsAdded = 0;
foreach (UUID uuid in m_assets.Keys)
{
AssetBase asset = m_assets[uuid];
@ -137,7 +144,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
archive.AddFile(
ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension,
asset.Data);
}
assetsAdded++;
if (assetsAdded % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0)
m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", assetsAdded);
}
if (assetsAdded % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL != 0)
m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", assetsAdded);
}
}
}