From bd9736c9f8b854bca4aa1d613fb6126b14d99c97 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sat, 12 Jul 2008 22:31:46 +0000
Subject: * Elminate most of the debugging log output from the archive commands
---
.../Modules/World/Archiver/ArchiveReadRequest.cs | 24 ++++++++++++----------
.../Archiver/ArchiveWriteRequestPreparation.cs | 20 +++++++++---------
.../Modules/World/Archiver/AssetsArchiver.cs | 2 +-
.../Modules/World/Archiver/TarArchiveReader.cs | 10 ++++-----
.../Modules/World/Archiver/TarArchiveWriter.cs | 12 +++++------
5 files changed, 35 insertions(+), 33 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index c9f8fce..0522372 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -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();
@@ -111,14 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
if (null != 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);
@@ -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);
+ }
}
///
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 153ecca..a0a579c 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -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);
}
}
}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
index ed07c9f..9a1b560 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
@@ -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);
}
}
}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
index 67f27b8..585d1d4 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
@@ -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
///
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);
}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
index 4bc37af..f70a93d 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
@@ -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
///
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 m_files = new Dictionary();
@@ -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);
--
cgit v1.1