mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Clean up logging calls using String.Format explicitly
This commit is contained in:
@@ -55,13 +55,13 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
|
||||
if (!String.IsNullOrEmpty(path))
|
||||
{
|
||||
m_log.Info(String.Format("[ASSETS]: Loading: [{0}][{1}]", name, path));
|
||||
m_log.InfoFormat("[ASSETS]: Loading: [{0}][{1}]", name, path);
|
||||
|
||||
LoadAsset(asset, isImage, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info(String.Format("[ASSETS]: Instantiated: [{0}]", name));
|
||||
m_log.InfoFormat("[ASSETS]: Instantiated: [{0}]", name);
|
||||
}
|
||||
|
||||
return asset;
|
||||
@@ -108,7 +108,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
}
|
||||
catch (XmlException e)
|
||||
{
|
||||
m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e));
|
||||
m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -126,7 +126,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
/// <param name="assets"></param>
|
||||
protected void LoadXmlAssetSet(string assetSetPath, List<AssetBase> assets)
|
||||
{
|
||||
m_log.Info(String.Format("[ASSETS]: Loading asset set {0}", assetSetPath));
|
||||
m_log.InfoFormat("[ASSETS]: Loading asset set {0}", assetSetPath);
|
||||
|
||||
if (File.Exists(assetSetPath))
|
||||
{
|
||||
@@ -152,12 +152,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
}
|
||||
catch (XmlException e)
|
||||
{
|
||||
m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e));
|
||||
m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error(String.Format("[ASSETS]: Asset set file {0} does not exist!", assetSetPath));
|
||||
m_log.ErrorFormat("[ASSETS]: Asset set file {0} does not exist!", assetSetPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +71,9 @@ namespace OpenSim.Framework
|
||||
|
||||
public void Remove(uint id)
|
||||
{
|
||||
//m_log.Info(String.Format("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count));
|
||||
//m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count);
|
||||
m_clients.Remove(id);
|
||||
m_log.Info(String.Format("[CLIENT]: Removed client with code {0}, new client count {1}", id, m_clients.Count));
|
||||
m_log.InfoFormat("[CLIENT]: Removed client with code {0}, new client count {1}", id, m_clients.Count);
|
||||
}
|
||||
|
||||
public void Add(uint id, IClientAPI client)
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
}
|
||||
|
||||
m_log.Info(String.Format("[ASSETCACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result));
|
||||
m_log.InfoFormat("[ASSETCACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result);
|
||||
}
|
||||
|
||||
public void DeleteAsset(LLUUID assetID)
|
||||
@@ -431,7 +431,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
//if (this.RequestedTextures.ContainsKey(assetID))
|
||||
//{
|
||||
// m_log.Warn(String.Format("[ASSET CACHE]: sending image not found for {0}", assetID));
|
||||
// m_log.WarnFormat("[ASSET CACHE]: sending image not found for {0}", assetID);
|
||||
// AssetRequest req = this.RequestedTextures[assetID];
|
||||
// ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
|
||||
// notFound.ImageID.ID = assetID;
|
||||
@@ -440,7 +440,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// m_log.Error(String.Format("[ASSET CACHE]: Cound not send image not found for {0}", assetID));
|
||||
// m_log.ErrorFormat("[ASSET CACHE]: Cound not send image not found for {0}", assetID);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
req.IsTexture = isTexture;
|
||||
m_assetRequests.Enqueue(req);
|
||||
|
||||
m_log.Info(String.Format("[ASSET]: Added {0} to request queue", assetID));
|
||||
m_log.InfoFormat("[ASSET]: Added {0} to request queue", assetID);
|
||||
}
|
||||
|
||||
public virtual void UpdateAsset(AssetBase asset)
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
// XXX Weak ass way of doing this by directly manipulating this public dictionary, purely temporary
|
||||
transactions.XferUploaders.Remove(uploader.TransactionID);
|
||||
|
||||
//m_log.Info(String.Format("[ASSET TRANSACTIONS] Current uploaders: {0}", transactions.XferUploaders.Count));
|
||||
//m_log.InfoFormat("[ASSET TRANSACTIONS] Current uploaders: {0}", transactions.XferUploaders.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
XferUploaders.Remove(uploaderFound.TransactionID);
|
||||
|
||||
//m_log.Info(String.Format("[ASSET TRANSACTIONS] Current uploaders: {0}", XferUploaders.Count));
|
||||
//m_log.InfoFormat("[ASSET TRANSACTIONS] Current uploaders: {0}", XferUploaders.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
Stream s = null;
|
||||
try
|
||||
{
|
||||
m_log.Debug(String.Format("[ASSETCACHE]: Querying for {0}", req.AssetID.ToString()));
|
||||
m_log.DebugFormat("[ASSETCACHE]: Querying for {0}", req.AssetID.ToString());
|
||||
|
||||
RestClient rc = new RestClient(_assetServerUrl);
|
||||
rc.AddResourcePath("assets");
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[ASSETCACHE]: " + e.Message);
|
||||
m_log.Debug(String.Format("[ASSETCACHE]: Getting asset {0}", req.AssetID.ToString()));
|
||||
m_log.DebugFormat("[ASSETCACHE]: Getting asset {0}", req.AssetID.ToString());
|
||||
m_log.Error("[ASSETCACHE]: " + e.StackTrace);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
// rc.RequestMethod = "POST";
|
||||
// rc.Request(s);
|
||||
//m_log.Info(String.Format("[ASSET]: Stored {0}", rc));
|
||||
//m_log.InfoFormat("[ASSET]: Stored {0}", rc);
|
||||
m_log.Info("[ASSET]: Sending to " + _assetServerUrl + "/assets/");
|
||||
RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error(String.Format("[USERCACHE]: User profile for user {0} not found", userID));
|
||||
m_log.ErrorFormat("[USERCACHE]: User profile for user {0} not found", userID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace OpenSim.Region.Capabilities
|
||||
{
|
||||
try
|
||||
{
|
||||
// m_log.Debug(String.Format("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param));
|
||||
// m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
|
||||
|
||||
Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request));
|
||||
LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
|
||||
@@ -709,7 +709,7 @@ namespace OpenSim.Region.Capabilities
|
||||
SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data);
|
||||
}
|
||||
|
||||
// m_log.Info(String.Format("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res));
|
||||
// m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
}
|
||||
realuri = sb.ToString();
|
||||
m_log.Info(String.Format("[REST]: RestURL: {0}", realuri));
|
||||
m_log.InfoFormat("[REST]: RestURL: {0}", realuri);
|
||||
return new Uri(sb.ToString());
|
||||
}
|
||||
|
||||
@@ -376,8 +376,8 @@ namespace OpenSim.Framework.Communications
|
||||
_asyncException = null;
|
||||
_request.ContentLength = src.Length;
|
||||
|
||||
m_log.Info(String.Format("[REST]: Request Length {0}", _request.ContentLength));
|
||||
m_log.Info(String.Format("[REST]: Sending Web Request {0}", buildUri()));
|
||||
m_log.InfoFormat("[REST]: Request Length {0}", _request.ContentLength);
|
||||
m_log.InfoFormat("[REST]: Sending Web Request {0}", buildUri());
|
||||
src.Seek(0, SeekOrigin.Begin);
|
||||
m_log.Info("[REST]: Seek is ok");
|
||||
Stream dst = _request.GetRequestStream();
|
||||
|
||||
@@ -100,9 +100,9 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(String.Format(
|
||||
"[ASSETS]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", assetID));
|
||||
m_log.ErrorFormat(
|
||||
"[ASSETS]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", assetID);
|
||||
_dbConnection.Reconnect();
|
||||
}
|
||||
}
|
||||
@@ -139,10 +139,10 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(String.Format(
|
||||
"[ASSETS]: " +
|
||||
"MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name));
|
||||
m_log.ErrorFormat(
|
||||
"[ASSETS]: " +
|
||||
"MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
|
||||
_dbConnection.Reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
|
||||
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
|
||||
{
|
||||
m_log.Info(String.Format("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID));
|
||||
m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
|
||||
DataTable prims = m_primTable;
|
||||
DataTable shapes = m_shapeTable;
|
||||
@@ -304,7 +304,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
/// <param name="prim"></param>
|
||||
private void LoadItems(SceneObjectPart prim)
|
||||
{
|
||||
//m_log.Info(String.Format("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID));
|
||||
//m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
|
||||
|
||||
DataTable dbItems = m_itemsTable;
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
TaskInventoryItem item = buildItem(row);
|
||||
inventory.Add(item);
|
||||
|
||||
m_log.Info(String.Format("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID));
|
||||
m_log.InfoFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
|
||||
}
|
||||
|
||||
prim.RestoreInventoryItems(inventory);
|
||||
@@ -1216,7 +1216,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.Info(String.Format("[DATASTORE]: Persisting Prim Inventory with prim ID {0}", primID));
|
||||
m_log.InfoFormat("[DATASTORE]: Persisting Prim Inventory with prim ID {0}", primID);
|
||||
|
||||
// For now, we're just going to crudely remove all the previous inventory items
|
||||
// no matter whether they have changed or not, and replace them with the current set.
|
||||
@@ -1227,10 +1227,10 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
// repalce with current inventory details
|
||||
foreach (TaskInventoryItem newItem in items)
|
||||
{
|
||||
// m_log.Info(String.Format(
|
||||
// "[DATASTORE]: " +
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// newItem.Name, newItem.ItemID, newItem.ParentPartID));
|
||||
// m_log.InfoFormat(
|
||||
// "[DATASTORE]: " +
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
|
||||
|
||||
DataRow newItemRow = m_itemsTable.NewRow();
|
||||
fillItemRow(newItemRow, newItem);
|
||||
@@ -1313,7 +1313,6 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
private string defineTable(DataTable dt)
|
||||
{
|
||||
string sql = "create table " + dt.TableName + "(";
|
||||
@@ -1334,7 +1333,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
sql += subsql;
|
||||
sql += ")";
|
||||
|
||||
//m_log.Info(String.Format("[DATASTORE]: defineTable() sql {0}", sql));
|
||||
//m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql);
|
||||
|
||||
return sql;
|
||||
}
|
||||
@@ -1477,7 +1476,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: Primitives Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: Primitives Table Already Exists: {0}", e);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1486,7 +1485,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: Shapes Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: Shapes Table Already Exists: {0}", e);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1495,7 +1494,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: Items Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: Items Table Already Exists: {0}", e);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1504,7 +1503,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: Terrain Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: Terrain Table Already Exists: {0}", e);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1513,7 +1512,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: Land Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: Land Table Already Exists: {0}", e);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1522,7 +1521,7 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
m_log.Warn(String.Format("[MySql]: LandAccessList Table Already Exists: {0}", e));
|
||||
m_log.WarnFormat("[MySql]: LandAccessList Table Already Exists: {0}", e);
|
||||
}
|
||||
conn.Close();
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
|
||||
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
|
||||
{
|
||||
m_log.Info(String.Format("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID));
|
||||
m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
|
||||
DataTable prims = ds.Tables["prims"];
|
||||
DataTable shapes = ds.Tables["primshapes"];
|
||||
@@ -350,7 +350,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
/// <param name="prim"></param>
|
||||
private void LoadItems(SceneObjectPart prim)
|
||||
{
|
||||
m_log.Info(String.Format("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID));
|
||||
m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
TaskInventoryItem item = buildItem(row);
|
||||
inventory.Add(item);
|
||||
|
||||
m_log.Info(String.Format("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID));
|
||||
m_log.InfoFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
|
||||
}
|
||||
|
||||
prim.RestoreInventoryItems(inventory);
|
||||
@@ -1174,7 +1174,6 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
byte[] textureEntry = (byte[]) row["Texture"];
|
||||
s.TextureEntry = textureEntry;
|
||||
|
||||
|
||||
s.ExtraParams = (byte[]) row["ExtraParams"];
|
||||
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
|
||||
// string texture = encoding.GetString((Byte[])row["Texture"]);
|
||||
@@ -1267,7 +1266,7 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.Info(String.Format("[DATASTORE]: Entered StorePrimInventory with prim ID {0}", primID));
|
||||
m_log.InfoFormat("[DATASTORE]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
@@ -1280,10 +1279,10 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
// repalce with current inventory details
|
||||
foreach (TaskInventoryItem newItem in items)
|
||||
{
|
||||
// m_log.Info(String.Format(
|
||||
// "[DATASTORE]: ",
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// newItem.Name, newItem.ItemID, newItem.ParentPartID));
|
||||
// m_log.InfoFormat(
|
||||
// "[DATASTORE]: ",
|
||||
// "Adding item {0}, {1} to prim ID {2}",
|
||||
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
|
||||
|
||||
DataRow newItemRow = dbItems.NewRow();
|
||||
fillItemRow(newItemRow, newItem);
|
||||
|
||||
Reference in New Issue
Block a user