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

View File

@ -135,14 +135,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
if (null != scriptAsset) if (null != scriptAsset)
{ {
string script = Helpers.FieldToUTF8String(scriptAsset.Data); 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); 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) foreach (Match uuidMatch in uuidMatches)
{ {
LLUUID uuid = new LLUUID(uuidMatch.Value); 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; assetUuids[uuid] = 1;
} }
} }
@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); AssetWearable wearableAsset = new AssetBodypart(assetBase.Data);
wearableAsset.Decode(); wearableAsset.Decode();
m_log.DebugFormat( //m_log.DebugFormat(
"[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
foreach (LLUUID uuid in wearableAsset.Textures.Values) foreach (LLUUID uuid in wearableAsset.Textures.Values)
{ {
@ -203,8 +203,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
foreach (SceneObjectPart part in sceneObject.GetParts()) foreach (SceneObjectPart part in sceneObject.GetParts())
{ {
m_log.DebugFormat( //m_log.DebugFormat(
"[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); // "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
try try
{ {
@ -220,14 +220,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{ {
if (texture != null) if (texture != null)
{ {
m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
assetUuids[texture.TextureID] = 1; assetUuids[texture.TextureID] = 1;
} }
} }
foreach (TaskInventoryItem tii in part.TaskInventory.Values) 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)) if (!assetUuids.ContainsKey(tii.AssetID))
{ {
@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
} }
else 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 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;
using System.IO; using System.IO;
using System.Reflection; //using System.Reflection;
using System.Text; using System.Text;
using log4net; //using log4net;
namespace OpenSim.Region.Environment.Modules.World.Archiver namespace OpenSim.Region.Environment.Modules.World.Archiver
{ {
@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
/// </summary> /// </summary>
public class TarArchiveReader 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(); protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
@ -78,14 +78,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
filePath = header.FilePath; filePath = header.FilePath;
byte[] data = m_br.ReadBytes(header.FileSize); 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 // Read the rest of the empty padding in the 512 byte block
if (header.FileSize % 512 != 0) if (header.FileSize % 512 != 0)
{ {
int paddingLeft = 512 - (header.FileSize % 512); 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); m_br.ReadBytes(paddingLeft);
} }

View File

@ -29,8 +29,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Reflection; //using System.Reflection;
using log4net; //using log4net;
namespace OpenSim.Region.Environment namespace OpenSim.Region.Environment
{ {
@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment
/// </summary> /// </summary>
public class TarArchiveWriter 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[]>(); protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>();
@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment
// file size in bytes (12) // file size in bytes (12)
int fileSize = data.Length; 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); byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11);
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment
checksum += b; 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); byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6);
@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment
{ {
int paddingRequired = 512 - (data.Length % 512); 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]; byte[] padding = new byte[paddingRequired];
bw.Write(padding); bw.Write(padding);