From 001ce95e4c4bf4f0929c2ced4ab22e3bc40fd1d6 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 13 Feb 2008 03:38:18 +0000 Subject: [PATCH] Clean up more unnecessary String.Format calls --- .../Cache/AgentAssetTransactions.cs | 7 +- .../Communications/Cache/AssetCache.cs | 4 +- .../Communications/Cache/AssetServerBase.cs | 9 +- .../Communications/Cache/LibraryRootFolder.cs | 16 ++-- .../Cache/UserProfileCacheService.cs | 13 ++- .../Communications/Capabilities/Caps.cs | 21 ++--- .../Communications/InventoryServiceBase.cs | 5 +- .../Framework/Communications/LoginService.cs | 6 +- .../Data.MySQL/Resources/AvatarAppearance.sql | 84 +++++++++---------- .../Environment/Scenes/Scene.Inventory.cs | 7 +- OpenSim/Region/Environment/Scenes/Scene.cs | 16 ++-- .../Physics/Manager/PhysicsPluginManager.cs | 2 +- 12 files changed, 83 insertions(+), 107 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs index d40c3544fc..3882ade603 100644 --- a/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AgentAssetTransactions.cs @@ -113,10 +113,9 @@ namespace OpenSim.Framework.Communications.Cache // [or maybe we can if we do more checking like data lenght checks] if (uploaderFound != null) { -// m_log.Info( -// String.Format( -// "[ASSET TRANSACTIONS] Removing asset xfer uploader with transfer id {0}, transaction {1}", -// xferID, uploaderFound.TransactionID)); +// m_log.InfoFormat( +// "[ASSET TRANSACTIONS] Removing asset xfer uploader with transfer id {0}, transaction {1}", +// xferID, uploaderFound.TransactionID); // XferUploaders.Remove(uploaderFound.TransactionID); diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 2b06d4f3af..effaa82b5c 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -266,9 +266,7 @@ namespace OpenSim.Framework.Communications.Cache } } while (--maxPolls > 0); - m_log.Warn( - String.Format("[ASSETCACHE]: Asset {0} was not received before the retrieval timeout was reached", assetID.ToString()) - ); + m_log.WarnFormat("[ASSETCACHE]: Asset {0} was not received before the retrieval timeout was reached", assetID.ToString()); return null; } diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 6cded491e0..6820027fcb 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -70,15 +70,13 @@ namespace OpenSim.Framework.Communications.Cache if (asset != null) { - //m_log.Info( - // String.Format("[ASSET]: Asset {0} received from asset server", req.AssetID)); + //m_log.InfoFormat("[ASSET]: Asset {0} received from asset server", req.AssetID); m_receiver.AssetReceived(asset, req.IsTexture); } else { - m_log.Error( - String.Format("[ASSET]: Asset {0} not found by asset server", req.AssetID)); + m_log.ErrorFormat("[ASSET]: Asset {0} not found by asset server", req.AssetID); m_receiver.AssetNotFound(req.AssetID); } @@ -93,7 +91,6 @@ namespace OpenSim.Framework.Communications.Cache CommitAssets(); } - public AssetServerBase() { m_log.Info("[ASSETSERVER]: Starting asset storage system"); @@ -163,4 +160,4 @@ namespace OpenSim.Framework.Communications.Cache { } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index 604cd2cedc..b3d3c7cc5c 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -140,9 +140,8 @@ namespace OpenSim.Framework.Communications.Cache /// protected void LoadLibraries(string librariesControlPath) { - m_log.Info( - String.Format( - "[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath)); + m_log.InfoFormat( + "[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath); LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig); } @@ -188,9 +187,8 @@ namespace OpenSim.Framework.Communications.Cache libraryFolders.Add(folderInfo.folderID, folderInfo); parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo); - -// m_log.Info( -// String.Format("[LIBRARY INVENTORY]: Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID)); + +// m_log.InfoFormat("[LIBRARY INVENTORY]: Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID); } else { @@ -258,14 +256,12 @@ namespace OpenSim.Framework.Communications.Cache } catch (XmlException e) { - m_log.Error( - String.Format("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e)); + m_log.ErrorFormat("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e); } } else { - m_log.Error( - String.Format("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path)); + m_log.ErrorFormat("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path); } } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 257747bd33..455f72226d 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -233,28 +233,25 @@ namespace OpenSim.Framework.Communications.Cache } else { - m_log.Error( - String.Format("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name)); + m_log.ErrorFormat("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name); return; } } else { - m_log.Error( - String.Format("[INVENTORYCACHE]: " + + m_log.ErrorFormat("[INVENTORYCACHE]: " + "Could not find user profile for {0} for folder {1}", - remoteClient.Name, folderID)); + remoteClient.Name, folderID); return; } // If we've reached this point then we couldn't find the folder, even though the client thinks // it exists - m_log.Error( - String.Format("[INVENTORYCACHE]: " + + m_log.ErrorFormat("[INVENTORYCACHE]: " + "Could not find folder {0} for user {1}", - folderID, remoteClient.Name)); + folderID, remoteClient.Name); } public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 1398184184..a360dc3ea0 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -305,10 +305,9 @@ namespace OpenSim.Region.Capabilities uploadResponse.uploader = uploaderURL; uploadResponse.state = "upload"; -// m_log.Info( -// String.Format("[CAPS]: " + -// "ScriptTaskInventory response: {0}", -// LLSDHelpers.SerialiseLLSDReply(uploadResponse))); +// m_log.InfoFormat("[CAPS]: " + +// "ScriptTaskInventory response: {0}", +// LLSDHelpers.SerialiseLLSDReply(uploadResponse))); return LLSDHelpers.SerialiseLLSDReply(uploadResponse); } @@ -351,10 +350,9 @@ namespace OpenSim.Region.Capabilities uploadResponse.uploader = uploaderURL; uploadResponse.state = "upload"; -// m_log.Info( -// String.Format("[CAPS]: " + -// "NoteCardAgentInventory response: {0}", -// LLSDHelpers.SerialiseLLSDReply(uploadResponse))); +// m_log.InfoFormat("[CAPS]: " + +// "NoteCardAgentInventory response: {0}", +// LLSDHelpers.SerialiseLLSDReply(uploadResponse))); return LLSDHelpers.SerialiseLLSDReply(uploadResponse); } @@ -683,10 +681,9 @@ namespace OpenSim.Region.Capabilities { try { -// m_log.Info( -// String.Format("[CAPS]: " + -// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", -// data, path, param)); +// m_log.InfoFormat("[CAPS]: " + +// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", +// data, path, param)); string res = String.Empty; LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index fd9ab1b849..74c07e1ef5 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -147,10 +147,9 @@ namespace OpenSim.Framework.Communications if (null != existingRootFolder) { - m_log.Error( - String.Format("[AGENTINVENTORY]: " + + m_log.ErrorFormat("[AGENTINVENTORY]: " + "Did not create a new inventory for user {0} since they already have " - + "a root inventory folder with id {1}", user, existingRootFolder)); + + "a root inventory folder with id {1}", user, existingRootFolder); } else { diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index db86a978ca..e14eccf31e 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -601,8 +601,7 @@ namespace OpenSim.Framework.UserManagement public virtual bool AuthenticateUser(UserProfileData profile, string password) { bool passwordSuccess = false; - m_log.Info( - String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID)); + m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); // Web Login method seems to also occasionally send the hashed password itself @@ -627,8 +626,7 @@ namespace OpenSim.Framework.UserManagement public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) { bool passwordSuccess = false; - m_log.Info( - String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID)); + m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); // Match web login key unless it's the default weblogin key LLUUID.Zero passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); diff --git a/OpenSim/Framework/Data.MySQL/Resources/AvatarAppearance.sql b/OpenSim/Framework/Data.MySQL/Resources/AvatarAppearance.sql index d9d3de08ad..b638ee2d7d 100644 --- a/OpenSim/Framework/Data.MySQL/Resources/AvatarAppearance.sql +++ b/OpenSim/Framework/Data.MySQL/Resources/AvatarAppearance.sql @@ -1,42 +1,42 @@ --- --- Create schema avatar_appearance --- - -CREATE DATABASE IF NOT EXISTS avatar_appearance; -USE avatar_appearance; - -DROP TABLE IF EXISTS `avatarappearance`; -CREATE TABLE `avatarappearance` ( - `UUID` char(36) NOT NULL, - `Serial` int(10) unsigned NOT NULL, - `WearableItem0` char(36) NOT NULL, - `WearableAsset0` char(36) NOT NULL, - `WearableItem1` char(36) NOT NULL, - `WearableAsset1` char(36) NOT NULL, - `WearableItem2` char(36) NOT NULL, - `WearableAsset2` char(36) NOT NULL, - `WearableItem3` char(36) NOT NULL, - `WearableAsset3` char(36) NOT NULL, - `WearableItem4` char(36) NOT NULL, - `WearableAsset4` char(36) NOT NULL, - `WearableItem5` char(36) NOT NULL, - `WearableAsset5` char(36) NOT NULL, - `WearableItem6` char(36) NOT NULL, - `WearableAsset6` char(36) NOT NULL, - `WearableItem7` char(36) NOT NULL, - `WearableAsset7` char(36) NOT NULL, - `WearableItem8` char(36) NOT NULL, - `WearableAsset8` char(36) NOT NULL, - `WearableItem9` char(36) NOT NULL, - `WearableAsset9` char(36) NOT NULL, - `WearableItem10` char(36) NOT NULL, - `WearableAsset10` char(36) NOT NULL, - `WearableItem11` char(36) NOT NULL, - `WearableAsset11` char(36) NOT NULL, - `WearableItem12` char(36) NOT NULL, - `WearableAsset12` char(36) NOT NULL, - - - PRIMARY KEY (`UUID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - +-- +-- Create schema avatar_appearance +-- + +CREATE DATABASE IF NOT EXISTS avatar_appearance; +USE avatar_appearance; + +DROP TABLE IF EXISTS `avatarappearance`; +CREATE TABLE `avatarappearance` ( + `UUID` char(36) NOT NULL, + `Serial` int(10) unsigned NOT NULL, + `WearableItem0` char(36) NOT NULL, + `WearableAsset0` char(36) NOT NULL, + `WearableItem1` char(36) NOT NULL, + `WearableAsset1` char(36) NOT NULL, + `WearableItem2` char(36) NOT NULL, + `WearableAsset2` char(36) NOT NULL, + `WearableItem3` char(36) NOT NULL, + `WearableAsset3` char(36) NOT NULL, + `WearableItem4` char(36) NOT NULL, + `WearableAsset4` char(36) NOT NULL, + `WearableItem5` char(36) NOT NULL, + `WearableAsset5` char(36) NOT NULL, + `WearableItem6` char(36) NOT NULL, + `WearableAsset6` char(36) NOT NULL, + `WearableItem7` char(36) NOT NULL, + `WearableAsset7` char(36) NOT NULL, + `WearableItem8` char(36) NOT NULL, + `WearableAsset8` char(36) NOT NULL, + `WearableItem9` char(36) NOT NULL, + `WearableAsset9` char(36) NOT NULL, + `WearableItem10` char(36) NOT NULL, + `WearableAsset10` char(36) NOT NULL, + `WearableItem11` char(36) NOT NULL, + `WearableAsset11` char(36) NOT NULL, + `WearableItem12` char(36) NOT NULL, + `WearableAsset12` char(36) NOT NULL, + + + PRIMARY KEY (`UUID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 6800d5f993..952b039654 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -600,10 +600,9 @@ namespace OpenSim.Region.Environment.Scenes group.StartScript(localID, copyID); group.GetProperties(remoteClient); - // m_log.Info( - // String.Format("[PRIMINVENTORY]: " + - // "Rezzed script {0} into prim local ID {1} for user {2}", - // item.inventoryName, localID, remoteClient.Name)); + // m_log.InfoFormat("[PRIMINVENTORY]: " + + // "Rezzed script {0} into prim local ID {1} for user {2}", + // item.inventoryName, localID, remoteClient.Name); } else { diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d763d35e8b..c41979c8f4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1477,8 +1477,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - m_log.Warn( - String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene ScenePresences list", agentID)); + m_log.WarnFormat("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene ScenePresences list", agentID); } } @@ -1490,8 +1489,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - m_log.Warn( - String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene Entities list", agentID)); + m_log.WarnFormat("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene Entities list", agentID); } } @@ -2302,21 +2300,19 @@ namespace OpenSim.Region.Environment.Scenes { case "users": m_log.Error("Current Region: " + RegionInfo.RegionName); - m_log.Error( - String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", - "Agent ID", "Session ID", "Circuit", "IP", "World")); + m_log.ErrorFormat("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", + "Agent ID", "Session ID", "Circuit", "IP", "World"); foreach (ScenePresence scenePrescence in GetAvatars()) { - m_log.Error( - String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", + m_log.ErrorFormat("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", scenePrescence.Firstname, scenePrescence.Lastname, scenePrescence.UUID, scenePrescence.ControllingClient.AgentId, "Unknown", "Unknown", - RegionInfo.RegionName)); + RegionInfo.RegionName); } break; case "modules": diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 82eef35636..76ea503b62 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -80,7 +80,7 @@ namespace OpenSim.Region.Physics.Manager } else { - m_log.Warn(String.Format("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName)); + m_log.WarnFormat("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName); throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName)); } }