Clean up logging calls using String.Format explicitly

This commit is contained in:
Jeff Ames
2008-02-10 01:57:59 +00:00
parent 523284c32a
commit e207284fef
35 changed files with 222 additions and 233 deletions

View File

@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment
DynamicTextureModule dynamicModule = new DynamicTextureModule();
if (m_loadedSharedModules.ContainsKey(dynamicModule.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule");
}
else
{
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment
ChatModule chat = new ChatModule();
if (m_loadedSharedModules.ContainsKey(chat.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule");
}
else
{
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment
InstantMessageModule imMod = new InstantMessageModule();
if (m_loadedSharedModules.ContainsKey(imMod.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule");
}
else
{
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment
LoadImageURLModule loadMod = new LoadImageURLModule();
if (m_loadedSharedModules.ContainsKey(loadMod.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule");
}
else
{
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment
AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule");
}
else
{
@@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment
XMLRPCModule xmlRpcMod = new XMLRPCModule();
if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name))
{
m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"));
m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule");
}
else
{
@@ -186,17 +186,17 @@ namespace OpenSim.Region.Environment
if (modules.Length > 0)
{
m_log.Info(String.Format("[MODULES]: Found Module Library [{0}]", dllName));
m_log.InfoFormat("[MODULES]: Found Module Library [{0}]", dllName);
foreach (IRegionModule module in modules)
{
if (!module.IsSharedModule)
{
m_log.Info(String.Format("[MODULES]: [{0}]: Initializing.", module.Name));
m_log.InfoFormat("[MODULES]: [{0}]: Initializing.", module.Name);
InitializeModule(module, scene);
}
else
{
m_log.Info(String.Format("[MODULES]: [{0}]: Loading Shared Module.", module.Name));
m_log.InfoFormat("[MODULES]: [{0}]: Loading Shared Module.", module.Name);
LoadSharedModule(module);
}
}
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment
}
catch (BadImageFormatException)
{
//m_log.Info(String.Format("[MODULES]: The file [{0}] is not a module assembly.", e.FileName));
//m_log.InfoFormat("[MODULES]: The file [{0}] is not a module assembly.", e.FileName);
}
}
@@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment
}
catch (ReflectionTypeLoadException)
{
m_log.Info(String.Format("[MODULES]: Could not load types for [{0}].", pluginAssembly.FullName));
m_log.InfoFormat("[MODULES]: Could not load types for [{0}].", pluginAssembly.FullName);
}
}

View File

@@ -174,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules
// Make sure that any sender we currently have can get garbage collected
sender = null;
//m_log.Info(String.Format("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count()));
//m_log.InfoFormat("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count());
}
}

View File

@@ -104,9 +104,9 @@ namespace OpenSim.Region.Environment.Modules
EnqueueTextureSender(textureSender);
}
//m_log.Info(String.Format("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID));
//m_log.InfoFormat("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID);
m_textureSenders.Remove(textureID);
//m_log.Info(String.Format("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count));
//m_log.InfoFormat("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count);
}
else
{

View File

@@ -925,9 +925,9 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Info(String.Format("[SCENE]: " +
"DelinkObjects(): Could not find a root prim out of {0} as given to a delink request!",
primIds));
m_log.InfoFormat("[SCENE]: " +
"DelinkObjects(): Could not find a root prim out of {0} as given to a delink request!",
primIds);
}
}
@@ -975,7 +975,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Warn(String.Format("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID));
m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID);
}
}

View File

@@ -83,8 +83,8 @@ namespace OpenSim.Region.Environment.Scenes
if (!TryGetAvatar(avatarId, out avatar))
{
m_log.Error(String.Format(
"[AGENTINVENTORY]: Could not find avatar {0} to add inventory item", avatarId));
m_log.ErrorFormat(
"[AGENTINVENTORY]: Could not find avatar {0} to add inventory item", avatarId);
return;
}
@@ -146,10 +146,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[AGENTINVENTORY]: " +
"Avatar {0} cannot be found to update its inventory item asset",
avatarId));
m_log.ErrorFormat(
"[AGENTINVENTORY]: " +
"Avatar {0} cannot be found to update its inventory item asset",
avatarId);
}
return LLUUID.Zero;
@@ -171,10 +171,10 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup group = part.ParentGroup;
if (null == group)
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
itemId, primId));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
itemId, primId);
return;
}
@@ -220,10 +220,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Avatar {0} cannot be found to update its prim item asset",
avatarId));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Avatar {0} cannot be found to update its prim item asset",
avatarId);
}
}
@@ -498,8 +498,8 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID);
}
}
@@ -524,11 +524,11 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Removal of item {0} requested of prim {1} but this prim does not exist",
itemID,
localID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Removal of item {0} requested of prim {1} but this prim does not exist",
itemID,
localID);
}
}
@@ -548,18 +548,18 @@ namespace OpenSim.Region.Environment.Scenes
{
// TODO Retrieve itemID from client's inventory to pass on
//group.AddInventoryItem(remoteClient, primLocalID, null);
m_log.Info(String.Format(
"[PRIMINVENTORY]: " +
"Non script prim inventory not yet implemented!"
+ "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
itemID, folderID, primLocalID, remoteClient.Name));
m_log.InfoFormat(
"[PRIMINVENTORY]: " +
"Non script prim inventory not yet implemented!"
+ "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
itemID, folderID, primLocalID, remoteClient.Name);
}
else
{
m_log.Warn(String.Format(
"[PRIMINVENTORY]: " +
"Update with item {0} requested of prim {1} for {2} but this prim does not exist",
itemID, primLocalID, remoteClient.Name));
m_log.WarnFormat(
"[PRIMINVENTORY]: " +
"Update with item {0} requested of prim {1} for {2} but this prim does not exist",
itemID, primLocalID, remoteClient.Name);
}
}
@@ -604,18 +604,18 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Could not rez script {0} into prim local ID {1} for user {2}"
+ " because the prim could not be found in the region!",
item.inventoryName, localID, remoteClient.Name));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Could not rez script {0} into prim local ID {1} for user {2}"
+ " because the prim could not be found in the region!",
item.inventoryName, localID, remoteClient.Name);
}
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: Could not find script inventory item {0} to rez for {1}!",
itemID, remoteClient.Name));
m_log.ErrorFormat(
"[PRIMINVENTORY]: Could not find script inventory item {0} to rez for {1}!",
itemID, remoteClient.Name);
}
}
}

View File

@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_scenePresences.Remove(agentID))
{
//m_log.Info(String.Format("[SCENE] Removed scene presence {0}", agentID));
//m_log.InfoFormat("[SCENE] Removed scene presence {0}", agentID);
}
else
{
@@ -1445,7 +1445,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (Entities.Remove(agentID))
{
//m_log.Info(String.Format("[SCENE] Removed scene presence {0} from entities list", agentID));
//m_log.InfoFormat("[SCENE] Removed scene presence {0} from entities list", agentID);
}
else
{
@@ -1470,8 +1470,8 @@ namespace OpenSim.Region.Environment.Scenes
// Remove client agent from profile, so new logins will work
CommsManager.UserService.clearUserAgent(agentID);
//m_log.Info(String.Format("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)));
//m_log.Info(String.Format("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)));
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
}
public override void CloseAllAgents(uint circuitcode)

View File

@@ -296,10 +296,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (!scenePresence.IsChildAgent)
{
m_log.Error(String.Format("Packet debug for {0} {1} set to {2}",
scenePresence.Firstname,
scenePresence.Lastname,
newDebug));
m_log.ErrorFormat("Packet debug for {0} {1} set to {2}",
scenePresence.Firstname,
scenePresence.Lastname,
newDebug);
scenePresence.ControllingClient.SetDebug(newDebug);
}

View File

@@ -55,10 +55,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
localID, Name, UUID, itemID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
localID, Name, UUID, itemID);
}
}
@@ -76,10 +76,10 @@ namespace OpenSim.Region.Environment.Scenes
// }
// else
// {
// m_log.Error(String.Format(
// "[PRIMINVENTORY]: " +
// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
// localID, Name, UUID, itemID));
// m_log.ErrorFormat(
// "[PRIMINVENTORY]: " +
// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
// localID, Name, UUID, itemID);
// }
// }
@@ -123,10 +123,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
partID, Name, UUID, itemID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
partID, Name, UUID, itemID);
}
}
@@ -144,10 +144,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
localID, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
localID, Name, UUID);
}
return false;
}
@@ -161,10 +161,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to request inventory data",
localID, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find part {0} in object group {1}, {2} to request inventory data",
localID, Name, UUID);
}
}
@@ -200,10 +200,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
localID, Name, UUID, newItemId));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
localID, Name, UUID, newItemId);
}
return false;
@@ -224,10 +224,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
primID, part.Name, part.UUID, itemID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
primID, part.Name, part.UUID, itemID);
}
return null;
@@ -250,10 +250,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't find prim ID {0} to update item {1}, {2}",
item.ParentPartID, item.Name, item.ItemID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't find prim ID {0} to update item {1}, {2}",
item.ParentPartID, item.Name, item.ItemID);
}
return false;

View File

@@ -1003,9 +1003,9 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Info(String.Format("[SCENE]: " +
"DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
partID, LocalId));
m_log.InfoFormat("[SCENE]: " +
"DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
partID, LocalId);
}
}

View File

@@ -147,10 +147,10 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns>
public void StartScript(TaskInventoryItem item)
{
// m_log.Info(String.Format(
// "[PRIMINVENTORY]: " +
// "Starting script {0}, {1} in prim {2}, {3}",
// item.Name, item.ItemID, Name, UUID));
// m_log.InfoFormat(
// "[PRIMINVENTORY]: " +
// "Starting script {0}, {1} in prim {2}, {3}",
// item.Name, item.ItemID, Name, UUID);
AddFlag(LLObject.ObjectFlags.Scripted);
if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
@@ -166,10 +166,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't start script {0}, {1} since asset ID {2} could not be found",
item.Name, item.ItemID, item.AssetID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't start script {0}, {1} since asset ID {2} could not be found",
item.Name, item.ItemID, item.AssetID);
}
}
ScheduleFullUpdate();
@@ -192,10 +192,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
itemId, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
itemId, Name, UUID);
}
}
}
@@ -206,27 +206,18 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="itemId"></param>
public void StopScript(LLUUID itemId)
{
if (m_taskInventory.ContainsKey(itemId))
{
m_parentGroup.Scene.EventManager.TriggerRemoveScript(LocalID, itemId);
m_parentGroup.AddActiveScriptCount(-1);
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}",
itemId, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}",
itemId, Name, UUID);
}
}
/// <summary>
@@ -285,10 +276,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, Name, UUID);
}
}
@@ -317,10 +308,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
item.ItemID, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
item.ItemID, Name, UUID);
}
}
@@ -374,10 +365,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
m_log.Error(String.Format(
"[PRIMINVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, Name, UUID));
m_log.ErrorFormat(
"[PRIMINVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, Name, UUID);
}
}
@@ -442,8 +433,8 @@ namespace OpenSim.Region.Environment.Scenes
fileData = Helpers.StringToField(invString.BuildString);
// m_log.Info(String.Format(
// "[PRIMINVENTORY]: RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData)));
// m_log.InfoFormat(
// "[PRIMINVENTORY]: RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData));
if (fileData.Length > 2)
{