mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
This commit is contained in:
@@ -40,19 +40,21 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
[Extension("/OpenSim/Startup")]
|
||||
public class LoadRegionsPlugin : IApplicationPlugin
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public void Initialise(OpenSimMain openSim)
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised");
|
||||
m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
|
||||
|
||||
IRegionLoader regionLoader;
|
||||
if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem");
|
||||
m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
|
||||
regionLoader = new RegionLoaderFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONSPLUGIN", "Loading Region Info from web");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: Loading Region Info from web");
|
||||
regionLoader = new RegionLoaderWebServer();
|
||||
}
|
||||
|
||||
@@ -63,7 +65,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
for (int i = 0; i < regionsToLoad.Length; i++)
|
||||
{
|
||||
MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
|
||||
m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
|
||||
openSim.CreateRegion(regionsToLoad[i]);
|
||||
}
|
||||
|
||||
@@ -73,17 +75,17 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle)
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised");
|
||||
m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
|
||||
|
||||
IRegionLoader regionLoader;
|
||||
if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem");
|
||||
m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
|
||||
regionLoader = new RegionLoaderFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from web");
|
||||
m_log.Info("[LOADREGIONS]: Loading Region Info from web");
|
||||
regionLoader = new RegionLoaderWebServer();
|
||||
}
|
||||
|
||||
@@ -93,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
if (regionhandle == regionsToLoad[i].RegionHandle)
|
||||
{
|
||||
MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
|
||||
m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
|
||||
openSim.CreateRegion(regionsToLoad[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,4 +64,4 @@ using System.Runtime.InteropServices;
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly : AssemblyVersion("1.0.0.0")]
|
||||
[assembly : AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly : AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
[Extension("/OpenSim/Startup")]
|
||||
public class RemoteAdminPlugin : IApplicationPlugin
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private OpenSimMain m_app;
|
||||
private BaseHttpServer m_httpd;
|
||||
private string requiredPassword = String.Empty;
|
||||
@@ -56,7 +58,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
if (openSim.ConfigSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Remote Admin Plugin Enabled");
|
||||
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
|
||||
requiredPassword = openSim.ConfigSource.Configs["RemoteAdmin"].GetString("access_password", String.Empty);
|
||||
|
||||
m_app = openSim;
|
||||
@@ -126,7 +128,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
else
|
||||
{
|
||||
string message = (string) requestData["message"];
|
||||
MainLog.Instance.Verbose("RADMIN", "Broadcasting: " + message);
|
||||
m_log.Info("[RADMIN]: Broadcasting: " + message);
|
||||
|
||||
responseData["accepted"] = "true";
|
||||
response.Value = responseData;
|
||||
@@ -153,7 +155,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
string file = (string)requestData["filename"];
|
||||
LLUUID regionID = LLUUID.Parse((string)requestData["regionid"]);
|
||||
MainLog.Instance.Verbose("RADMIN", "Terrain Loading: " + file);
|
||||
m_log.Info("[RADMIN]: Terrain Loading: " + file);
|
||||
|
||||
responseData["accepted"] = "true";
|
||||
|
||||
@@ -177,7 +179,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request");
|
||||
m_log.Info("[RADMIN]: Received Shutdown Administrator Request");
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
Hashtable responseData = new Hashtable();
|
||||
@@ -233,7 +235,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public XmlRpcResponse XmlRpcCreateRegionMethod(XmlRpcRequest request)
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Received Create Region Administrator Request");
|
||||
m_log.Info("[RADMIN]: Received Create Region Administrator Request");
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
Hashtable responseData = new Hashtable();
|
||||
@@ -284,7 +286,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request)
|
||||
{
|
||||
MainLog.Instance.Verbose("RADMIN", "Received Create User Administrator Request");
|
||||
m_log.Info("[RADMIN]: Received Create User Administrator Request");
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
Hashtable responseData = new Hashtable();
|
||||
@@ -312,14 +314,14 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
responseData["error"] = "Error creating user";
|
||||
responseData["avatar_uuid"] = LLUUID.Zero;
|
||||
response.Value = responseData;
|
||||
MainLog.Instance.Error("RADMIN", "Error creating user (" + tempfirstname + " " + templastname + ") :");
|
||||
m_log.Error("[RADMIN]: Error creating user (" + tempfirstname + " " + templastname + ") :");
|
||||
}
|
||||
else
|
||||
{
|
||||
responseData["created"] = "true";
|
||||
responseData["avatar_uuid"] = tempuserID;
|
||||
response.Value = responseData;
|
||||
MainLog.Instance.Verbose("RADMIN", "User " + tempfirstname + " " + templastname + " created. Userid " + tempuserID + " assigned.");
|
||||
m_log.Info("[RADMIN]: User " + tempfirstname + " " + templastname + " created. Userid " + tempuserID + " assigned.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user