diff options
author | Charles Krinke | 2009-02-22 20:52:55 +0000 |
---|---|---|
committer | Charles Krinke | 2009-02-22 20:52:55 +0000 |
commit | 8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49 (patch) | |
tree | 96a24a49de82056060dd9b7bab0cb209d5f1a129 /OpenSim/Region/ScriptEngine/Shared/Api/Runtime | |
parent | Allow delivery of object messages gridwide (diff) | |
download | opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.zip opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.gz opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.bz2 opensim-SC_OLD-8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49.tar.xz |
Mantis#3218. Thank you kindly, TLaukkan (Tommil) for a patch that:
* Added log4net dependency to physxplugin in prebuild.xml.
* Added missing m_log fields to classes.
* Replaced Console.WriteLine with appropriate m_log.Xxxx
* Tested that nant test target runs succesfully.
* Tested that local opensim sandbox starts up without errors.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | 12 |
2 files changed, 20 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index d76c7c1..3a73674 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs | |||
@@ -31,11 +31,14 @@ using System.Reflection; | |||
31 | using System.Runtime.Remoting.Lifetime; | 31 | using System.Runtime.Remoting.Lifetime; |
32 | using OpenSim.Region.ScriptEngine.Shared; | 32 | using OpenSim.Region.ScriptEngine.Shared; |
33 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 33 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
34 | using log4net; | ||
34 | 35 | ||
35 | namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | 36 | namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase |
36 | { | 37 | { |
37 | public class Executor : MarshalByRefObject | 38 | public class Executor : MarshalByRefObject |
38 | { | 39 | { |
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
39 | /// <summary> | 42 | /// <summary> |
40 | /// Contains the script to execute functions in. | 43 | /// Contains the script to execute functions in. |
41 | /// </summary> | 44 | /// </summary> |
@@ -92,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
92 | /// <returns></returns> | 95 | /// <returns></returns> |
93 | public override Object InitializeLifetimeService() | 96 | public override Object InitializeLifetimeService() |
94 | { | 97 | { |
95 | //Console.WriteLine("Executor: InitializeLifetimeService()"); | 98 | //m_log.Debug("Executor: InitializeLifetimeService()"); |
96 | // return null; | 99 | // return null; |
97 | ILease lease = (ILease)base.InitializeLifetimeService(); | 100 | ILease lease = (ILease)base.InitializeLifetimeService(); |
98 | 101 | ||
@@ -108,7 +111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
108 | 111 | ||
109 | public scriptEvents GetStateEventFlags(string state) | 112 | public scriptEvents GetStateEventFlags(string state) |
110 | { | 113 | { |
111 | //Console.WriteLine("Get event flags for " + state); | 114 | //m_log.Debug("Get event flags for " + state); |
112 | 115 | ||
113 | // Check to see if we've already computed the flags for this state | 116 | // Check to see if we've already computed the flags for this state |
114 | scriptEvents eventFlags = scriptEvents.None; | 117 | scriptEvents eventFlags = scriptEvents.None; |
@@ -124,19 +127,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
124 | foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap) | 127 | foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap) |
125 | { | 128 | { |
126 | string evname = state + "_event_" + kvp.Key; | 129 | string evname = state + "_event_" + kvp.Key; |
127 | //Console.WriteLine("Trying event "+evname); | 130 | //m_log.Debug("Trying event "+evname); |
128 | try | 131 | try |
129 | { | 132 | { |
130 | MethodInfo mi = type.GetMethod(evname); | 133 | MethodInfo mi = type.GetMethod(evname); |
131 | if (mi != null) | 134 | if (mi != null) |
132 | { | 135 | { |
133 | //Console.WriteLine("Found handler for " + kvp.Key); | 136 | //m_log.Debug("Found handler for " + kvp.Key); |
134 | eventFlags |= kvp.Value; | 137 | eventFlags |= kvp.Value; |
135 | } | 138 | } |
136 | } | 139 | } |
137 | catch(Exception) | 140 | catch(Exception) |
138 | { | 141 | { |
139 | //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); | 142 | //m_log.Debug("Exeption in GetMethod:\n"+e.ToString()); |
140 | } | 143 | } |
141 | } | 144 | } |
142 | 145 | ||
@@ -144,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
144 | if (eventFlags != 0) | 147 | if (eventFlags != 0) |
145 | m_stateEvents.Add(state, eventFlags); | 148 | m_stateEvents.Add(state, eventFlags); |
146 | 149 | ||
147 | //Console.WriteLine("Returning {0:x}", eventFlags); | 150 | //m_log.Debug("Returning {0:x}", eventFlags); |
148 | return (eventFlags); | 151 | return (eventFlags); |
149 | } | 152 | } |
150 | 153 | ||
@@ -156,7 +159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
156 | string EventName = state + "_event_" + FunctionName; | 159 | string EventName = state + "_event_" + FunctionName; |
157 | 160 | ||
158 | //#if DEBUG | 161 | //#if DEBUG |
159 | //Console.WriteLine("ScriptEngine: Script event function name: " + EventName); | 162 | //m_log.Debug("ScriptEngine: Script event function name: " + EventName); |
160 | //#endif | 163 | //#endif |
161 | 164 | ||
162 | if (Events.ContainsKey(EventName) == false) | 165 | if (Events.ContainsKey(EventName) == false) |
@@ -170,7 +173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
170 | } | 173 | } |
171 | catch | 174 | catch |
172 | { | 175 | { |
173 | Console.WriteLine("Event {0}not found", EventName); | 176 | m_log.Error("Event "+EventName+" not found."); |
174 | // Event name not found, cache it as not found | 177 | // Event name not found, cache it as not found |
175 | Events.Add(EventName, null); | 178 | Events.Add(EventName, null); |
176 | } | 179 | } |
@@ -182,13 +185,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
182 | 185 | ||
183 | if (ev == null) // No event by that name! | 186 | if (ev == null) // No event by that name! |
184 | { | 187 | { |
185 | //Console.WriteLine("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty); | 188 | //m_log.Debug("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty); |
186 | return; | 189 | return; |
187 | } | 190 | } |
188 | 191 | ||
189 | //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined | 192 | //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined |
190 | #if DEBUG | 193 | #if DEBUG |
191 | //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); | 194 | //m_log.Debug("ScriptEngine: Executing function name: " + EventName); |
192 | #endif | 195 | #endif |
193 | // Found | 196 | // Found |
194 | try | 197 | try |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 5a9b0aa..9cdffaa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -36,6 +36,7 @@ using System.Reflection; | |||
36 | using System.Net.Sockets; | 36 | using System.Net.Sockets; |
37 | using System.Text; | 37 | using System.Text; |
38 | using System.Text.RegularExpressions; | 38 | using System.Text.RegularExpressions; |
39 | using log4net; | ||
39 | 40 | ||
40 | namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | 41 | namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog |
41 | { | 42 | { |
@@ -45,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
45 | /// </summary> | 46 | /// </summary> |
46 | public class YP | 47 | public class YP |
47 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | private static Fail _fail = new Fail(); | 50 | private static Fail _fail = new Fail(); |
49 | private static Repeat _repeat = new Repeat(); | 51 | private static Repeat _repeat = new Repeat(); |
50 | private static Dictionary<NameArity, List<IClause>> _predicatesStore = | 52 | private static Dictionary<NameArity, List<IClause>> _predicatesStore = |
@@ -2341,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2341 | string results = ""; | 2343 | string results = ""; |
2342 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2344 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2343 | { | 2345 | { |
2344 | //Console.WriteLine( m ); | 2346 | //m_log.Debug( m ); |
2345 | results += presep+ m + postsep; | 2347 | results += presep+ m + postsep; |
2346 | } | 2348 | } |
2347 | return results; | 2349 | return results; |
@@ -2359,7 +2361,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2359 | } | 2361 | } |
2360 | catch | 2362 | catch |
2361 | { | 2363 | { |
2362 | Console.WriteLine("Failed to connect to server at {0}:999", "localhost"); | 2364 | m_log.Error("Failed to connect to server at localhost:999"); |
2363 | return ""; | 2365 | return ""; |
2364 | } | 2366 | } |
2365 | 2367 | ||
@@ -2379,16 +2381,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2379 | streamWriter.Flush(); | 2381 | streamWriter.Flush(); |
2380 | 2382 | ||
2381 | cycOutputString = streamReader.ReadLine(); | 2383 | cycOutputString = streamReader.ReadLine(); |
2382 | Console.WriteLine("Cycoutput:" + cycOutputString); | 2384 | m_log.Debug("Cycoutput:" + cycOutputString); |
2383 | //streamWriter.WriteLine("Client Message"); | 2385 | //streamWriter.WriteLine("Client Message"); |
2384 | //Console.WriteLine("Client Message"); | 2386 | //m_log.Debug("Client Message"); |
2385 | streamWriter.Flush(); | 2387 | streamWriter.Flush(); |
2386 | } | 2388 | } |
2387 | 2389 | ||
2388 | } | 2390 | } |
2389 | catch | 2391 | catch |
2390 | { | 2392 | { |
2391 | Console.WriteLine("Exception reading from Server"); | 2393 | m_log.Error("Exception reading from Server"); |
2392 | return ""; | 2394 | return ""; |
2393 | } | 2395 | } |
2394 | // tidy up | 2396 | // tidy up |