aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptServer/ScriptServerMain.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Grid/ScriptServer/ScriptServerMain.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/ScriptServer/ScriptServerMain.cs23
1 files changed, 9 insertions, 14 deletions
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs
index 421467d..e2c83f1 100644
--- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs
+++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs
@@ -40,11 +40,12 @@ namespace OpenSim.Grid.ScriptServer
40{ 40{
41 public class ScriptServerMain : BaseOpenSimServer, conscmd_callback 41 public class ScriptServerMain : BaseOpenSimServer, conscmd_callback
42 { 42 {
43 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44
43 // 45 //
44 // Root object. Creates objects used. 46 // Root object. Creates objects used.
45 // 47 //
46 private int listenPort = 8010; 48 private int listenPort = 8010;
47 private readonly string m_logFilename = ("scriptserver.log");
48 49
49 // TEMP 50 // TEMP
50 public static ScriptServerInterfaces.ScriptEngine Engine; 51 public static ScriptServerInterfaces.ScriptEngine Engine;
@@ -59,16 +60,15 @@ namespace OpenSim.Grid.ScriptServer
59 60
60 public ScriptServerMain() 61 public ScriptServerMain()
61 { 62 {
62 m_log = CreateLog(); 63 m_console = CreateConsole();
63
64 64
65 // Set up script engine mananger 65 // Set up script engine mananger
66 ScriptEngines = new ScriptEngineManager(this, m_log); 66 ScriptEngines = new ScriptEngineManager(this);
67 67
68 // Load DotNetEngine 68 // Load DotNetEngine
69 Engine = ScriptEngines.LoadEngine("DotNetEngine"); 69 Engine = ScriptEngines.LoadEngine("DotNetEngine");
70 IConfigSource config = null; 70 IConfigSource config = null;
71 Engine.InitializeEngine(null, null, m_log, false, Engine.GetScriptManager()); 71 Engine.InitializeEngine(null, null, false, Engine.GetScriptManager());
72 72
73 73
74 // Set up server 74 // Set up server
@@ -83,12 +83,12 @@ namespace OpenSim.Grid.ScriptServer
83 83
84 private void RPC_ReceiveCommand(int ID, string Command, object[] p) 84 private void RPC_ReceiveCommand(int ID, string Command, object[] p)
85 { 85 {
86 m_log.Notice("SERVER", "Received command: '" + Command + "'"); 86 m_log.Info("[SERVER]: Received command: '" + Command + "'");
87 if (p != null) 87 if (p != null)
88 { 88 {
89 for (int i = 0; i < p.Length; i++) 89 for (int i = 0; i < p.Length; i++)
90 { 90 {
91 m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); 91 m_log.Info("[SERVER]: Param " + i + ": " + p[i].ToString());
92 } 92 }
93 } 93 }
94 94
@@ -102,14 +102,9 @@ namespace OpenSim.Grid.ScriptServer
102 { 102 {
103 } 103 }
104 104
105 protected LogBase CreateLog() 105 protected ConsoleBase CreateConsole()
106 { 106 {
107 if (!Directory.Exists(Util.logDir())) 107 return new ConsoleBase("ScriptServer", this);
108 {
109 Directory.CreateDirectory(Util.logDir());
110 }
111
112 return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "ScriptServer", this, true);
113 } 108 }
114 } 109 }
115} 110}