Minor improvements to logging

Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
0.7.4.1
Oren Hurvitz 2012-04-23 15:31:45 +03:00 committed by Justin Clark-Casey (justincc)
parent d3a4d67a20
commit 2f398231ac
6 changed files with 24 additions and 12 deletions

View File

@ -296,6 +296,10 @@ namespace OpenSim.Framework.Console
matches[0].Groups["Category"].Value);
System.Console.Write("]:");
}
else
{
outText = outText.Trim();
}
}
if (level == "error")

View File

@ -143,7 +143,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
catch (Exception e)
{
m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace);
UUID agentId = (sp.ControllingClient == null) ? (UUID)null : sp.ControllingClient.AgentId;
m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment with itemID {0}, assetID {1}, point {2} for {3}: {4}\n{5}",
attach.ItemID, attach.AssetID, p, agentId, e.Message, e.StackTrace);
}
}
}

View File

@ -248,10 +248,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
if (bakedTextureFace == null)
{
m_log.WarnFormat(
"[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
bakeType, sp.Name, m_scene.RegionInfo.RegionName);
// This can happen legitimately, since some baked textures might not exist
//m_log.WarnFormat(
// "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
// bakeType, sp.Name, m_scene.RegionInfo.RegionName);
continue;
}
@ -417,7 +417,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
bakedTextures[bakeType] = faceTextures[ftIndex];
Primitive.TextureEntryFace texture = faceTextures[ftIndex]; // this will be null if there's no such baked texture
bakedTextures[bakeType] = texture;
}
return bakedTextures;

View File

@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
sp.CompleteMovement(npcAvatar, false);
m_avatars.Add(npcAvatar.AgentId, npcAvatar);
m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
return npcAvatar.AgentId;
}
@ -299,7 +299,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
scene.RemoveClient(agentID, false);
m_avatars.Remove(agentID);
// m_log.DebugFormat("[NPC MODULE]: Removed {0} {1}", agentID, av.Name);
m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name);
return true;
}
}

View File

@ -1812,9 +1812,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// if there already exists a file at that location, it may be locked.
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message);
}
string textpath = path + ".text";
try
{
using (FileStream fs = File.Create(path + ".text"))
using (FileStream fs = File.Create(textpath))
{
using (StreamWriter sw = new StreamWriter(fs))
{
@ -1827,7 +1829,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
catch (IOException ex)
{
// if there already exists a file at that location, it may be locked.
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message);
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", textpath, ex.Message);
}
}
}
@ -1876,7 +1878,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
catch (IOException ex)
{
// if there already exists a file at that location, it may be locked.
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message);
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", mappath, ex.Message);
}
}

View File

@ -117,7 +117,10 @@ namespace OpenSim.Server.Base
catch (Exception e)
{
if (!(e is System.MissingMethodException))
m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
{
m_log.ErrorFormat("Error loading plugin {0} from {1}. Exception: {2}",
interfaceName, dllName, e.InnerException == null ? e.Message : e.InnerException.Message);
}
return null;
}