mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Massive console refactor. Greatly simplify interface.
This commit is contained in:
11
OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
Normal file → Executable file
11
OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
Normal file → Executable file
@@ -150,26 +150,27 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel)))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("Usage: debug eq [0|1|2]");
|
||||
MainConsole.Instance.Output("Usage: debug eq [0|1|2]");
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugLevel = debugLevel;
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Set event queue debug level to {0} in {1}", DebugLevel, m_scene.RegionInfo.RegionName);
|
||||
MainConsole.Instance.Output(
|
||||
"Set event queue debug level to {0} in {1}", null, DebugLevel, m_scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
protected void HandleShowEq(string module, string[] args)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("For scene {0}", m_scene.Name);
|
||||
MainConsole.Instance.Output("For scene {0}", null, m_scene.Name);
|
||||
|
||||
lock (queues)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, Queue<OSD>> kvp in queues)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"For agent {0} there are {1} messages queued for send.",
|
||||
null,
|
||||
kvp.Key, kvp.Value.Count);
|
||||
}
|
||||
}
|
||||
|
||||
82
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
Normal file → Executable file
82
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
Normal file → Executable file
@@ -222,7 +222,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||
return;
|
||||
|
||||
m_console.OutputFormat("Throttles for {0}", m_udpServer.Scene.Name);
|
||||
m_console.Output("Throttles for {0}", null, m_udpServer.Scene.Name);
|
||||
ConsoleDisplayList cdl = new ConsoleDisplayList();
|
||||
cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled);
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
m_console.Output(cdl.ToString());
|
||||
|
||||
m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer));
|
||||
m_console.Output("{0}\n", null, GetServerThrottlesReport(m_udpServer));
|
||||
}
|
||||
|
||||
private string GetServerThrottlesReport(LLUDPServer udpServer)
|
||||
@@ -297,7 +297,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (args.Length != 7)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("Usage: debug lludp data out <true|false> <avatar-first-name> <avatar-last-name>");
|
||||
MainConsole.Instance.Output("Usage: debug lludp data out <true|false> <avatar-first-name> <avatar-last-name>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,8 +312,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (sp.Firstname == firstName && sp.Lastname == lastName)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Data debug for {0} ({1}) set to {2} in {3}",
|
||||
null,
|
||||
sp.Name, sp.IsChildAgent ? "child" : "root", level, m_udpServer.Scene.Name);
|
||||
|
||||
((LLClientView)sp.ControllingClient).UDPClient.DebugDataOutLevel = level;
|
||||
@@ -331,7 +332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (!all && !one)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Usage: debug lludp throttles log <level> [<avatar-first-name> <avatar-last-name>]");
|
||||
return;
|
||||
}
|
||||
@@ -353,8 +354,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Throttle log level for {0} ({1}) set to {2} in {3}",
|
||||
null,
|
||||
sp.Name, sp.IsChildAgent ? "child" : "root", level, m_udpServer.Scene.Name);
|
||||
|
||||
((LLClientView)sp.ControllingClient).UDPClient.ThrottleDebugLevel = level;
|
||||
@@ -372,7 +374,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (!all && !one)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Usage: debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]");
|
||||
return;
|
||||
}
|
||||
@@ -399,8 +401,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Setting param {0} to {1} for {2} ({3}) in {4}",
|
||||
null,
|
||||
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
|
||||
|
||||
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
|
||||
@@ -422,8 +425,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Setting param {0} to {1} for {2} ({3}) in {4}",
|
||||
null,
|
||||
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
|
||||
|
||||
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
|
||||
@@ -443,8 +447,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Setting param {0} to {1} for {2} ({3}) in {4}",
|
||||
null,
|
||||
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
|
||||
|
||||
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
|
||||
@@ -464,7 +469,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (!all && !one)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Usage: debug lludp throttles get [<avatar-first-name> <avatar-last-name>]");
|
||||
return;
|
||||
}
|
||||
@@ -482,8 +487,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
|
||||
{
|
||||
m_console.OutputFormat(
|
||||
m_console.Output(
|
||||
"Status for {0} ({1}) in {2}",
|
||||
null,
|
||||
sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
|
||||
|
||||
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
|
||||
@@ -504,7 +510,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||
return;
|
||||
|
||||
m_console.OutputFormat("Debug settings for {0}", m_udpServer.Scene.Name);
|
||||
m_console.Output("Debug settings for {0}", null, m_udpServer.Scene.Name);
|
||||
ConsoleDisplayList cdl = new ConsoleDisplayList();
|
||||
|
||||
long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
|
||||
@@ -527,7 +533,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (args.Length != 5)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("Usage: debug lludp set <param> <value>");
|
||||
MainConsole.Instance.Output("Usage: debug lludp set <param> <value>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -555,7 +561,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return;
|
||||
}
|
||||
|
||||
m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
|
||||
m_console.Output("{0} set to {1} in {2}", null, param, rawValue, m_udpServer.Scene.Name);
|
||||
}
|
||||
|
||||
/* not in use, nothing to set/get from lludp
|
||||
@@ -632,7 +638,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("ERROR: Cannot specify a user name when setting default/all logging level");
|
||||
MainConsole.Instance.Output("ERROR: Cannot specify a user name when setting default/all logging level");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -646,16 +652,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_udpServer.DefaultClientPacketDebugLevel = newDebug;
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Packet debug for {0} clients set to {1} in {2}",
|
||||
null,
|
||||
(setAll ? "all" : "future"), m_udpServer.DefaultClientPacketDebugLevel, m_udpServer.Scene.Name);
|
||||
|
||||
if (setAll)
|
||||
{
|
||||
m_udpServer.Scene.ForEachScenePresence(sp =>
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Packet debug for {0} ({1}) set to {2} in {3}",
|
||||
null,
|
||||
sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_udpServer.Scene.Name);
|
||||
|
||||
sp.ControllingClient.DebugPacketLevel = newDebug;
|
||||
@@ -668,8 +676,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
if (name == null || sp.Name == name)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Packet debug for {0} ({1}) set to {2} in {3}",
|
||||
null,
|
||||
sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_udpServer.Scene.Name);
|
||||
|
||||
sp.ControllingClient.DebugPacketLevel = newDebug;
|
||||
@@ -701,8 +710,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (subCommand == "add")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Adding packet {0} to {1} drop list for all connections in {2}",
|
||||
null,
|
||||
direction, packetName, m_udpServer.Scene.Name);
|
||||
|
||||
m_udpServer.Scene.ForEachScenePresence(
|
||||
@@ -719,8 +729,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
else if (subCommand == "remove")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output(
|
||||
"Removing packet {0} from {1} drop list for all connections in {2}",
|
||||
null,
|
||||
direction, packetName, m_udpServer.Scene.Name);
|
||||
|
||||
m_udpServer.Scene.ForEachScenePresence(
|
||||
@@ -784,8 +795,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
m_udpServer.DiscardInboundAgentUpdates = !m_udpServer.DiscardInboundAgentUpdates;
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Discard AgentUpdates now {0} for {1}", m_udpServer.DiscardInboundAgentUpdates, m_udpServer.Scene.Name);
|
||||
MainConsole.Instance.Output(
|
||||
"Discard AgentUpdates now {0} for {1}", null, m_udpServer.DiscardInboundAgentUpdates, m_udpServer.Scene.Name);
|
||||
}
|
||||
|
||||
private void HandleStatusCommand(string module, string[] args)
|
||||
@@ -793,14 +804,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||
return;
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"IN LLUDP packet processing for {0} is {1}", m_udpServer.Scene.Name, m_udpServer.IsRunningInbound ? "enabled" : "disabled");
|
||||
MainConsole.Instance.Output(
|
||||
"IN LLUDP packet processing for {0} is {1}", null, m_udpServer.Scene.Name, m_udpServer.IsRunningInbound ? "enabled" : "disabled");
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"OUT LLUDP packet processing for {0} is {1}", m_udpServer.Scene.Name, m_udpServer.IsRunningOutbound ? "enabled" : "disabled");
|
||||
MainConsole.Instance.Output(
|
||||
"OUT LLUDP packet processing for {0} is {1}", null, m_udpServer.Scene.Name, m_udpServer.IsRunningOutbound ? "enabled" : "disabled");
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Packet debug level for new clients is {0}", m_udpServer.DefaultClientPacketDebugLevel);
|
||||
MainConsole.Instance.Output(
|
||||
"Packet debug level for new clients is {0}", null, m_udpServer.DefaultClientPacketDebugLevel);
|
||||
}
|
||||
|
||||
private void HandleOqreCommand(string module, string[] args)
|
||||
@@ -819,24 +830,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (subCommand == "stop")
|
||||
{
|
||||
m_udpServer.OqrEngine.Stop();
|
||||
MainConsole.Instance.OutputFormat("Stopped OQRE for {0}", m_udpServer.Scene.Name);
|
||||
MainConsole.Instance.Output("Stopped OQRE for {0}", null, m_udpServer.Scene.Name);
|
||||
}
|
||||
else if (subCommand == "start")
|
||||
{
|
||||
m_udpServer.OqrEngine.Start();
|
||||
MainConsole.Instance.OutputFormat("Started OQRE for {0}", m_udpServer.Scene.Name);
|
||||
MainConsole.Instance.Output("Started OQRE for {0}", null, m_udpServer.Scene.Name);
|
||||
}
|
||||
else if (subCommand == "status")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("OQRE in {0}", m_udpServer.Scene.Name);
|
||||
MainConsole.Instance.OutputFormat("Running: {0}", m_udpServer.OqrEngine.IsRunning);
|
||||
MainConsole.Instance.OutputFormat(
|
||||
MainConsole.Instance.Output("OQRE in {0}", null, m_udpServer.Scene.Name);
|
||||
MainConsole.Instance.Output("Running: {0}", null, m_udpServer.OqrEngine.IsRunning);
|
||||
MainConsole.Instance.Output(
|
||||
"Requests waiting: {0}",
|
||||
null,
|
||||
m_udpServer.OqrEngine.IsRunning ? m_udpServer.OqrEngine.JobsWaiting.ToString() : "n/a");
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("Unrecognized OQRE subcommand {0}", subCommand);
|
||||
MainConsole.Instance.Output("Unrecognized OQRE subcommand {0}", null, subCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user