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.
This commit is contained in:
Charles Krinke
2009-02-22 20:52:55 +00:00
parent 913654f2c9
commit 8f55b9d735
117 changed files with 580 additions and 409 deletions

View File

@@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Do we have any scripts in this object at all? If not, return
if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false)
{
//Console.WriteLine("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
//m_log.Debug("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
return false;
}

View File

@@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
if (DateTime.Now.Ticks - Last_ReReadConfigFilens >
m_ScriptEngine.RefreshConfigFilens)
{
//Console.WriteLine("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens);
//m_log.Debug("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens);
// Its time to re-read config file
m_ScriptEngine.ReadConfig();
Last_ReReadConfigFilens = DateTime.Now.Ticks; // Reset time

View File

@@ -45,9 +45,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
[Serializable]
public class ScriptEngine : IRegionModule, IScriptEngine, IScriptModule
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static List<ScriptEngine> ScriptEngines =
new List<ScriptEngine>();
@@ -265,7 +263,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
catch (AppDomainUnloadedException)
{
Console.WriteLine("[SCRIPT]: state change called when "+
m_log.Error("[SCRIPT]: state change called when "+
"script was unloaded. Nothing to worry about, "+
"but noting the occurance");
}
@@ -285,7 +283,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
catch (AppDomainUnloadedException)
{
Console.WriteLine("[SCRIPT]: state change called when "+
m_log.Error("[SCRIPT]: state change called when "+
"script was unloaded. Nothing to worry about, but "+
"noting the occurance");
}

View File

@@ -58,6 +58,7 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
using System.Reflection;
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
@@ -66,6 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// </summary>
public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected IScriptEngine m_ScriptEngine;
protected SceneObjectPart m_host;
protected uint m_localID;
@@ -1135,7 +1137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetStatus(int status)
{
m_host.AddScriptLPS(1);
// Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString());
// m_log.Debug(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString());
switch (status)
{
case ScriptBaseClass.STATUS_PHYSICS:
@@ -2706,8 +2708,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.Guid;
msg.toAgentID = new Guid(user); // toAgentID.Guid;
msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here
// Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message);
// Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString());
// m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message);
// m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString());
msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp;
//if (client != null)
//{
@@ -7882,7 +7884,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
catch(Exception e)
{
Console.WriteLine("[LSL_API]: llRequestSimulatorData" + e.ToString());
m_log.Error("[LSL_API]: llRequestSimulatorData" + e.ToString());
return UUID.Zero.ToString();
}
}
@@ -9068,7 +9070,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
System.Text.ASCIIEncoding enc =
new System.Text.ASCIIEncoding();
string data = enc.GetString(a.Data);
//Console.WriteLine(data);
//m_log.Debug(data);
NotecardCache.Cache(id, data);
AsyncCommands.
DataserverPlugin.DataserverReply(id.ToString(),
@@ -9114,7 +9116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
System.Text.ASCIIEncoding enc =
new System.Text.ASCIIEncoding();
string data = enc.GetString(a.Data);
//Console.WriteLine(data);
//m_log.Debug(data);
NotecardCache.Cache(id, data);
AsyncCommands.
DataserverPlugin.DataserverReply(id.ToString(),

View File

@@ -842,7 +842,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
for (i=0;i<JSON.Length; i++)
{
// Console.WriteLine(""+JSON[i]);
// m_log.Debug(""+JSON[i]);
switch (JSON[i])
{
case '{':

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
while (httpInfo != null)
{
//System.Console.WriteLine("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);
//m_log.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status);
// Deliver data to prim's remote_data handler
//

View File

@@ -108,7 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// Time has passed?
if (ts.next < DateTime.Now.Ticks)
{
//Console.WriteLine("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
// Add it to queue
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
new EventParams("timer", new Object[0],

View File

@@ -31,11 +31,14 @@ using System.Reflection;
using System.Runtime.Remoting.Lifetime;
using OpenSim.Region.ScriptEngine.Shared;
using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
using log4net;
namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
public class Executor : MarshalByRefObject
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Contains the script to execute functions in.
/// </summary>
@@ -92,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
/// <returns></returns>
public override Object InitializeLifetimeService()
{
//Console.WriteLine("Executor: InitializeLifetimeService()");
//m_log.Debug("Executor: InitializeLifetimeService()");
// return null;
ILease lease = (ILease)base.InitializeLifetimeService();
@@ -108,7 +111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public scriptEvents GetStateEventFlags(string state)
{
//Console.WriteLine("Get event flags for " + state);
//m_log.Debug("Get event flags for " + state);
// Check to see if we've already computed the flags for this state
scriptEvents eventFlags = scriptEvents.None;
@@ -124,19 +127,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
foreach (KeyValuePair<string, scriptEvents> kvp in m_eventFlagsMap)
{
string evname = state + "_event_" + kvp.Key;
//Console.WriteLine("Trying event "+evname);
//m_log.Debug("Trying event "+evname);
try
{
MethodInfo mi = type.GetMethod(evname);
if (mi != null)
{
//Console.WriteLine("Found handler for " + kvp.Key);
//m_log.Debug("Found handler for " + kvp.Key);
eventFlags |= kvp.Value;
}
}
catch(Exception)
{
//Console.WriteLine("Exeption in GetMethod:\n"+e.ToString());
//m_log.Debug("Exeption in GetMethod:\n"+e.ToString());
}
}
@@ -144,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
if (eventFlags != 0)
m_stateEvents.Add(state, eventFlags);
//Console.WriteLine("Returning {0:x}", eventFlags);
//m_log.Debug("Returning {0:x}", eventFlags);
return (eventFlags);
}
@@ -156,7 +159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
string EventName = state + "_event_" + FunctionName;
//#if DEBUG
//Console.WriteLine("ScriptEngine: Script event function name: " + EventName);
//m_log.Debug("ScriptEngine: Script event function name: " + EventName);
//#endif
if (Events.ContainsKey(EventName) == false)
@@ -170,7 +173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
}
catch
{
Console.WriteLine("Event {0}not found", EventName);
m_log.Error("Event "+EventName+" not found.");
// Event name not found, cache it as not found
Events.Add(EventName, null);
}
@@ -182,13 +185,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
if (ev == null) // No event by that name!
{
//Console.WriteLine("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty);
//m_log.Debug("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty);
return;
}
//cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined
#if DEBUG
//Console.WriteLine("ScriptEngine: Executing function name: " + EventName);
//m_log.Debug("ScriptEngine: Executing function name: " + EventName);
#endif
// Found
try

View File

@@ -36,6 +36,7 @@ using System.Reflection;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using log4net;
namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
{
@@ -45,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
/// </summary>
public class YP
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static Fail _fail = new Fail();
private static Repeat _repeat = new Repeat();
private static Dictionary<NameArity, List<IClause>> _predicatesStore =
@@ -2341,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
string results = "";
for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch())
{
//Console.WriteLine( m );
//m_log.Debug( m );
results += presep+ m + postsep;
}
return results;
@@ -2359,7 +2361,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
}
catch
{
Console.WriteLine("Failed to connect to server at {0}:999", "localhost");
m_log.Error("Failed to connect to server at localhost:999");
return "";
}
@@ -2379,16 +2381,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
streamWriter.Flush();
cycOutputString = streamReader.ReadLine();
Console.WriteLine("Cycoutput:" + cycOutputString);
m_log.Debug("Cycoutput:" + cycOutputString);
//streamWriter.WriteLine("Client Message");
//Console.WriteLine("Client Message");
//m_log.Debug("Client Message");
streamWriter.Flush();
}
}
catch
{
Console.WriteLine("Exception reading from Server");
m_log.Error("Exception reading from Server");
return "";
}
// tidy up

View File

@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
YP.see(myCode_SR);
YP.tell(myCS_SW);
//Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n");
//m_log.Debug("Mycode\n ===================================\n" + myCode+"\n");
// disable warning: don't see how we can code this differently short
// of rewriting the whole thing
@@ -78,9 +78,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode))
{
// ListPair VFC = new ListPair(FunctionCode, new Variable());
//Console.WriteLine("-------------------------")
//Console.WriteLine(FunctionCode.ToString())
//Console.WriteLine("-------------------------")
//m_log.Debug("-------------------------")
//m_log.Debug(FunctionCode.ToString())
//m_log.Debug("-------------------------")
YPCompiler.convertFunctionCSharp(FunctionCode);
//YPCompiler.convertStringCodesCSharp(VFC);
}

View File

@@ -451,11 +451,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public void VarDump(Dictionary<string, object> vars)
{
Console.WriteLine("Variable dump for script {0}", m_ItemID.ToString());
m_log.Info("Variable dump for script "+ m_ItemID.ToString());
foreach (KeyValuePair<string, object> v in vars)
{
Console.WriteLine("Variable: {0} = '{1}'", v. Key,
v.Value.ToString());
m_log.Info("Variable: "+v.Key+" = "+v.Value.ToString());
}
}
@@ -881,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
}
catch(Exception e)
{
Console.WriteLine("Unable to save xml\n"+e.ToString());
m_log.Error("Unable to save xml\n"+e.ToString());
}
if (!File.Exists(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state")))
{

View File

@@ -83,7 +83,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (part == null)
return;
Console.WriteLine("Paid: {0} from {1}, amount {2}", objectID,agentID,amount);
m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount);
if (part.ParentGroup != null)
part = part.ParentGroup.RootPart;