Enhances logging manager, Uses concept of Level and above for logging, The levels are Debug, Error, Info, Warn and None. Setting Settings.LOG_LEVEL to any of these settings will get you that level and above only.
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1850 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -12,6 +12,7 @@ namespace libsecondlife.TestClient
|
||||
{
|
||||
AutoResetEvent UploadCompleteEvent = new AutoResetEvent(false);
|
||||
LLUUID TextureID = LLUUID.Zero;
|
||||
DateTime start;
|
||||
|
||||
public UploadImageCommand(TestClient testClient)
|
||||
{
|
||||
@@ -39,7 +40,7 @@ namespace libsecondlife.TestClient
|
||||
if (jpeg2k == null)
|
||||
return "Failed to compress image to JPEG2000";
|
||||
Console.WriteLine("Finished compressing image to JPEG2000, uploading...");
|
||||
|
||||
start = DateTime.Now;
|
||||
DoUpload(jpeg2k, inventoryName);
|
||||
|
||||
if (UploadCompleteEvent.WaitOne((int)timeout, false))
|
||||
@@ -75,6 +76,7 @@ namespace libsecondlife.TestClient
|
||||
success, status, itemID, assetID));
|
||||
|
||||
TextureID = assetID;
|
||||
Console.WriteLine(String.Format("Upload took {0}", DateTime.Now.Subtract(start)));
|
||||
UploadCompleteEvent.Set();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -10,27 +10,42 @@ namespace libsecondlife.TestClient
|
||||
public DebugCommand(TestClient testClient)
|
||||
{
|
||||
Name = "debug";
|
||||
Description = "Turn debug messages on or off. Usage: debug [on/off]";
|
||||
Description = "Turn debug messages on or off. Usage: debug [level] where level is one of None, Debug, Error, Info, Warn";
|
||||
}
|
||||
|
||||
public override string Execute(string[] args, LLUUID fromAgentID)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
return "Usage: debug [on/off]";
|
||||
return "Usage: debug [level] where level is one of None, Debug, Error, Info, Warn";
|
||||
|
||||
if (args[0].ToLower() == "on")
|
||||
if (args[0].ToLower() == "debug")
|
||||
{
|
||||
Client.Settings.DEBUG = true;
|
||||
return "Debug logging is on";
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.Debug;
|
||||
return "Logging is set to Debug";
|
||||
}
|
||||
else if (args[0].ToLower() == "off")
|
||||
else if (args[0].ToLower() == "none")
|
||||
{
|
||||
Client.Settings.DEBUG = false;
|
||||
return "Debug logging is off";
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.None;
|
||||
return "Logging is set to None";
|
||||
}
|
||||
else if (args[0].ToLower() == "warn")
|
||||
{
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.Warning;
|
||||
return "Logging is set to level Warning";
|
||||
}
|
||||
else if (args[0].ToLower() == "info")
|
||||
{
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.Info;
|
||||
return "Logging is set to level Info";
|
||||
}
|
||||
else if (args[0].ToLower() == "error")
|
||||
{
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.Error;
|
||||
return "Logging is set to level Error";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Usage: debug [on/off]";
|
||||
return "Usage: debug [level] where level is one of None, Debug, Error, Info, Warn";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace libsecondlife.TestClient
|
||||
|
||||
RegisterAllCommands(Assembly.GetExecutingAssembly());
|
||||
|
||||
Settings.DEBUG = true;
|
||||
Settings.LOG_LEVEL = Helpers.LogLevel.Debug;
|
||||
Settings.LOG_RESENDS = false;
|
||||
Settings.STORE_LAND_PATCHES = true;
|
||||
Settings.ALWAYS_DECODE_OBJECTS = true;
|
||||
|
||||
Reference in New Issue
Block a user