From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: 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. --- OpenSim/Region/Examples/SimpleApp/Program.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Examples/SimpleApp/Program.cs') diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 6c18540..f919276 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -51,9 +51,9 @@ namespace SimpleApp private string m_userPlugin = "OpenSim.Framework.Data.SQLite.dll"; private string m_inventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; - protected override LogBase CreateLog() + protected override ConsoleBase CreateConsole() { - return new LogBase(null, "SimpleApp", this, true); + return new ConsoleBase("SimpleApp", this); } protected override void Initialize() @@ -64,12 +64,12 @@ namespace SimpleApp LocalAssetServer assetServer = new LocalAssetServer(); - m_assetCache = new AssetCache(assetServer, m_log); + m_assetCache = new AssetCache(assetServer); } public void Run() { - StartLog(); + StartConsole(); StartUp(); LocalInventoryService inventoryService = new LocalInventoryService(); @@ -94,7 +94,7 @@ namespace SimpleApp m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); - m_log.Notice(m_log.LineInfo); + m_console.Notice(m_console.LineInfo); IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), (int) m_networkServersInfo.HttpListenerPort); @@ -104,7 +104,7 @@ namespace SimpleApp UDPServer udpServer; - m_moduleLoader = new ModuleLoader(m_log, m_config); + m_moduleLoader = new ModuleLoader(m_config); m_moduleLoader.LoadDefaultSharedModules(); Scene scene = SetupScene(regionInfo, out udpServer, false); @@ -170,8 +170,8 @@ namespace SimpleApp scene.AddEntity(fileObject); } - m_log.Notice("Press enter to quit."); - m_log.ReadLine(); + m_console.Notice("Press enter to quit."); + m_console.ReadLine(); } protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, @@ -182,7 +182,7 @@ namespace SimpleApp return new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, - new ModuleLoader(m_log, m_config), true, false); + new ModuleLoader(m_config), true, false); } protected override StorageManager CreateStorageManager(string connectionstring) @@ -211,6 +211,8 @@ namespace SimpleApp private static void Main(string[] args) { + log4net.Config.XmlConfigurator.Configure(); + Program app = new Program(); app.Run(); -- cgit v1.1