* Elminate most of the debugging log output from the archive commands

0.6.0-stable
Justin Clarke Casey 2008-07-12 22:31:46 +00:00
parent da55f4d2ae
commit bd9736c9f8
5 changed files with 35 additions and 33 deletions

View File

@ -62,6 +62,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
protected void DearchiveRegion()
{
m_log.InfoFormat("[ARCHIVER]: Restoring archive {0}", m_loadPath);
TarArchiveReader archive
= new TarArchiveReader(
new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress));
@ -73,8 +75,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
byte[] data;
while ((data = archive.ReadEntry(out filePath)) != null)
{
m_log.DebugFormat(
"[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath);
//m_log.DebugFormat(
// "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length);
if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
{
@ -95,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
}
}
m_log.Debug("[ARCHIVER]: Reached end of archive");
//m_log.Debug("[ARCHIVER]: Reached end of archive");
archive.Close();
@ -113,13 +115,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
sceneObjects.Add(sceneObject);
}
m_log.Debug("[ARCHIVER]: Starting scripts");
foreach (SceneObjectGroup sceneObject in sceneObjects)
{
sceneObject.CreateScriptInstances(0, true);
}
m_log.InfoFormat("[ARCHIVER]: Restored {0} objects to the scene", sceneObjects.Count);
int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count;
@ -128,6 +123,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
m_log.WarnFormat("[ARCHIVER]: Ignored {0} objects that already existed in the scene", ignoredObjects);
m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
m_log.Debug("[ARCHIVER]: Starting scripts");
foreach (SceneObjectGroup sceneObject in sceneObjects)
{
sceneObject.CreateScriptInstances(0, true);
}
}
/// <summary>

View File

@ -135,14 +135,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
if (null != scriptAsset)
{
string script = Helpers.FieldToUTF8String(scriptAsset.Data);
m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
//m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
MatchCollection uuidMatches = m_uuidRegex.Matches(script);
m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
//m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
foreach (Match uuidMatch in uuidMatches)
{
LLUUID uuid = new LLUUID(uuidMatch.Value);
m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
//m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
assetUuids[uuid] = 1;
}
}
@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
AssetWearable wearableAsset = new AssetBodypart(assetBase.Data);
wearableAsset.Decode();
m_log.DebugFormat(
"[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
//m_log.DebugFormat(
// "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
foreach (LLUUID uuid in wearableAsset.Textures.Values)
{
@ -203,8 +203,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
foreach (SceneObjectPart part in sceneObject.GetParts())
{
m_log.DebugFormat(
"[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
//m_log.DebugFormat(
// "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
try
{
@ -220,14 +220,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{
if (texture != null)
{
m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
//m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
assetUuids[texture.TextureID] = 1;
}
}
foreach (TaskInventoryItem tii in part.TaskInventory.Values)
{
m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
//m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
if (!assetUuids.ContainsKey(tii.AssetID))
{
@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
}
else
{
m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
//m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
}
}
}

View File

@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
}
else
{
m_log.DebugFormat("[ARCHIVER]: Could not find asset {0} to archive", uuid);
m_log.WarnFormat("[ARCHIVER]: Could not find asset {0} to archive", uuid);
}
}
}

View File

@ -27,9 +27,9 @@
using System;
using System.IO;
using System.Reflection;
//using System.Reflection;
using System.Text;
using log4net;
//using log4net;
namespace OpenSim.Region.Environment.Modules.World.Archiver
{
@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary>
public class TarArchiveReader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
@ -78,14 +78,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
filePath = header.FilePath;
byte[] data = m_br.ReadBytes(header.FileSize);
m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
//m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
// Read the rest of the empty padding in the 512 byte block
if (header.FileSize % 512 != 0)
{
int paddingLeft = 512 - (header.FileSize % 512);
m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft);
//m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft);
m_br.ReadBytes(paddingLeft);
}

View File

@ -29,8 +29,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Reflection;
using log4net;
//using System.Reflection;
//using log4net;
namespace OpenSim.Region.Environment
{
@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment
/// </summary>
public class TarArchiveWriter
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>();
@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment
// file size in bytes (12)
int fileSize = data.Length;
m_log.DebugFormat("[TAR ARCHIVE WRITER]: File size of {0} is {1}", filePath, fileSize);
//m_log.DebugFormat("[TAR ARCHIVE WRITER]: File size of {0} is {1}", filePath, fileSize);
byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11);
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment
checksum += b;
}
m_log.DebugFormat("[TAR ARCHIVE WRITER]: Decimal header checksum is {0}", checksum);
//m_log.DebugFormat("[TAR ARCHIVE WRITER]: Decimal header checksum is {0}", checksum);
byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6);
@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment
{
int paddingRequired = 512 - (data.Length % 512);
m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired);
//m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired);
byte[] padding = new byte[paddingRequired];
bw.Write(padding);