aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-12 22:31:46 +0000
committerJustin Clarke Casey2008-07-12 22:31:46 +0000
commitbd9736c9f8b854bca4aa1d613fb6126b14d99c97 (patch)
treede554480f6db9b19b00b691f0dba6aa39a778381
parent* minor: comment out a couple of lines to eliminate nhibernate compile warnin... (diff)
downloadopensim-SC_OLD-bd9736c9f8b854bca4aa1d613fb6126b14d99c97.zip
opensim-SC_OLD-bd9736c9f8b854bca4aa1d613fb6126b14d99c97.tar.gz
opensim-SC_OLD-bd9736c9f8b854bca4aa1d613fb6126b14d99c97.tar.bz2
opensim-SC_OLD-bd9736c9f8b854bca4aa1d613fb6126b14d99c97.tar.xz
* Elminate most of the debugging log output from the archive commands
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs24
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs12
5 files changed, 35 insertions, 33 deletions
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
62 62
63 protected void DearchiveRegion() 63 protected void DearchiveRegion()
64 { 64 {
65 m_log.InfoFormat("[ARCHIVER]: Restoring archive {0}", m_loadPath);
66
65 TarArchiveReader archive 67 TarArchiveReader archive
66 = new TarArchiveReader( 68 = new TarArchiveReader(
67 new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); 69 new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress));
@@ -73,8 +75,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
73 byte[] data; 75 byte[] data;
74 while ((data = archive.ReadEntry(out filePath)) != null) 76 while ((data = archive.ReadEntry(out filePath)) != null)
75 { 77 {
76 m_log.DebugFormat( 78 //m_log.DebugFormat(
77 "[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath); 79 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length);
78 80
79 if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) 81 if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
80 { 82 {
@@ -95,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
95 } 97 }
96 } 98 }
97 99
98 m_log.Debug("[ARCHIVER]: Reached end of archive"); 100 //m_log.Debug("[ARCHIVER]: Reached end of archive");
99 101
100 archive.Close(); 102 archive.Close();
101 103
@@ -111,14 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
111 113
112 if (null != sceneObject) 114 if (null != sceneObject)
113 sceneObjects.Add(sceneObject); 115 sceneObjects.Add(sceneObject);
114 } 116 }
115
116 m_log.Debug("[ARCHIVER]: Starting scripts");
117
118 foreach (SceneObjectGroup sceneObject in sceneObjects)
119 {
120 sceneObject.CreateScriptInstances(0, true);
121 }
122 117
123 m_log.InfoFormat("[ARCHIVER]: Restored {0} objects to the scene", sceneObjects.Count); 118 m_log.InfoFormat("[ARCHIVER]: Restored {0} objects to the scene", sceneObjects.Count);
124 119
@@ -128,6 +123,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
128 m_log.WarnFormat("[ARCHIVER]: Ignored {0} objects that already existed in the scene", ignoredObjects); 123 m_log.WarnFormat("[ARCHIVER]: Ignored {0} objects that already existed in the scene", ignoredObjects);
129 124
130 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 125 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
126
127 m_log.Debug("[ARCHIVER]: Starting scripts");
128
129 foreach (SceneObjectGroup sceneObject in sceneObjects)
130 {
131 sceneObject.CreateScriptInstances(0, true);
132 }
131 } 133 }
132 134
133 /// <summary> 135 /// <summary>
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
135 if (null != scriptAsset) 135 if (null != scriptAsset)
136 { 136 {
137 string script = Helpers.FieldToUTF8String(scriptAsset.Data); 137 string script = Helpers.FieldToUTF8String(scriptAsset.Data);
138 m_log.DebugFormat("[ARCHIVER]: Script {0}", script); 138 //m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
139 MatchCollection uuidMatches = m_uuidRegex.Matches(script); 139 MatchCollection uuidMatches = m_uuidRegex.Matches(script);
140 m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); 140 //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
141 141
142 foreach (Match uuidMatch in uuidMatches) 142 foreach (Match uuidMatch in uuidMatches)
143 { 143 {
144 LLUUID uuid = new LLUUID(uuidMatch.Value); 144 LLUUID uuid = new LLUUID(uuidMatch.Value);
145 m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); 145 //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
146 assetUuids[uuid] = 1; 146 assetUuids[uuid] = 1;
147 } 147 }
148 } 148 }
@@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); 160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data);
161 wearableAsset.Decode(); 161 wearableAsset.Decode();
162 162
163 m_log.DebugFormat( 163 //m_log.DebugFormat(
164 "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); 164 // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
165 165
166 foreach (LLUUID uuid in wearableAsset.Textures.Values) 166 foreach (LLUUID uuid in wearableAsset.Textures.Values)
167 { 167 {
@@ -203,8 +203,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
203 203
204 foreach (SceneObjectPart part in sceneObject.GetParts()) 204 foreach (SceneObjectPart part in sceneObject.GetParts())
205 { 205 {
206 m_log.DebugFormat( 206 //m_log.DebugFormat(
207 "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); 207 // "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
208 208
209 try 209 try
210 { 210 {
@@ -220,14 +220,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
220 { 220 {
221 if (texture != null) 221 if (texture != null)
222 { 222 {
223 m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); 223 //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
224 assetUuids[texture.TextureID] = 1; 224 assetUuids[texture.TextureID] = 1;
225 } 225 }
226 } 226 }
227 227
228 foreach (TaskInventoryItem tii in part.TaskInventory.Values) 228 foreach (TaskInventoryItem tii in part.TaskInventory.Values)
229 { 229 {
230 m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); 230 //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
231 231
232 if (!assetUuids.ContainsKey(tii.AssetID)) 232 if (!assetUuids.ContainsKey(tii.AssetID))
233 { 233 {
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
247 } 247 }
248 else 248 else
249 { 249 {
250 m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID); 250 //m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
251 } 251 }
252 } 252 }
253 } 253 }
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
136 } 136 }
137 else 137 else
138 { 138 {
139 m_log.DebugFormat("[ARCHIVER]: Could not find asset {0} to archive", uuid); 139 m_log.WarnFormat("[ARCHIVER]: Could not find asset {0} to archive", uuid);
140 } 140 }
141 } 141 }
142 } 142 }
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 @@
27 27
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Reflection; 30//using System.Reflection;
31using System.Text; 31using System.Text;
32using log4net; 32//using log4net;
33 33
34namespace OpenSim.Region.Environment.Modules.World.Archiver 34namespace OpenSim.Region.Environment.Modules.World.Archiver
35{ 35{
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
38 /// </summary> 38 /// </summary>
39 public class TarArchiveReader 39 public class TarArchiveReader
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); 43 protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
44 44
@@ -78,14 +78,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
78 filePath = header.FilePath; 78 filePath = header.FilePath;
79 byte[] data = m_br.ReadBytes(header.FileSize); 79 byte[] data = m_br.ReadBytes(header.FileSize);
80 80
81 m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize); 81 //m_log.DebugFormat("[TAR ARCHIVE READER]: filePath {0}, fileSize {1}", filePath, header.FileSize);
82 82
83 // Read the rest of the empty padding in the 512 byte block 83 // Read the rest of the empty padding in the 512 byte block
84 if (header.FileSize % 512 != 0) 84 if (header.FileSize % 512 != 0)
85 { 85 {
86 int paddingLeft = 512 - (header.FileSize % 512); 86 int paddingLeft = 512 - (header.FileSize % 512);
87 87
88 m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft); 88 //m_log.DebugFormat("[TAR ARCHIVE READER]: Reading {0} padding bytes", paddingLeft);
89 89
90 m_br.ReadBytes(paddingLeft); 90 m_br.ReadBytes(paddingLeft);
91 } 91 }
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;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Text; 31using System.Text;
32using System.Reflection; 32//using System.Reflection;
33using log4net; 33//using log4net;
34 34
35namespace OpenSim.Region.Environment 35namespace OpenSim.Region.Environment
36{ 36{
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment
39 /// </summary> 39 /// </summary>
40 public class TarArchiveWriter 40 public class TarArchiveWriter
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>(); 44 protected Dictionary<string, byte[]> m_files = new Dictionary<string, byte[]>();
45 45
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment
111 111
112 // file size in bytes (12) 112 // file size in bytes (12)
113 int fileSize = data.Length; 113 int fileSize = data.Length;
114 m_log.DebugFormat("[TAR ARCHIVE WRITER]: File size of {0} is {1}", filePath, fileSize); 114 //m_log.DebugFormat("[TAR ARCHIVE WRITER]: File size of {0} is {1}", filePath, fileSize);
115 115
116 byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11); 116 byte[] fileSizeBytes = ConvertDecimalToPaddedOctalBytes(fileSize, 11);
117 117
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment
144 checksum += b; 144 checksum += b;
145 } 145 }
146 146
147 m_log.DebugFormat("[TAR ARCHIVE WRITER]: Decimal header checksum is {0}", checksum); 147 //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Decimal header checksum is {0}", checksum);
148 148
149 byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6); 149 byte[] checkSumBytes = ConvertDecimalToPaddedOctalBytes(checksum, 6);
150 150
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment
162 { 162 {
163 int paddingRequired = 512 - (data.Length % 512); 163 int paddingRequired = 512 - (data.Length % 512);
164 164
165 m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); 165 //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired);
166 166
167 byte[] padding = new byte[paddingRequired]; 167 byte[] padding = new byte[paddingRequired];
168 bw.Write(padding); 168 bw.Write(padding);