mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-13 00:02:50 +00:00
update UI service client to allow for SetLogLevel
This commit is contained in:
@@ -24,8 +24,20 @@ using System.Windows.Documents;
|
||||
/// </summary>
|
||||
namespace ZitiDesktopEdge.ServiceClient
|
||||
{
|
||||
public enum LogLevelEnum
|
||||
{
|
||||
FATAL = 0,
|
||||
ERROR = 1,
|
||||
WARN = 2,
|
||||
INFO = 3,
|
||||
DEBUG = 4,
|
||||
TRACE = 5,
|
||||
VERBOSE = 6,
|
||||
}
|
||||
|
||||
internal class Client
|
||||
{
|
||||
|
||||
public const int EXPECTED_API_VERSION = 1;
|
||||
|
||||
public event EventHandler<TunnelStatusEvent> OnTunnelStatusEvent;
|
||||
@@ -378,6 +390,22 @@ namespace ZitiDesktopEdge.ServiceClient
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLogLevel(LogLevelEnum level)
|
||||
{
|
||||
try
|
||||
{
|
||||
send(new SetLogLevelFunction(Enum.GetName(level.GetType(), level)));
|
||||
SvcResponse resp = read<SvcResponse>(ipcReader);
|
||||
return;
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
//almost certainly a problem with the pipe - recreate the pipe...
|
||||
//setupPipe();
|
||||
throw ioe;
|
||||
}
|
||||
}
|
||||
|
||||
public Identity IdentityOnOff(string fingerprint, bool onOff)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -73,6 +73,10 @@ namespace ZitiDesktopEdge.ServiceClient
|
||||
public bool OnOff { get; set; }
|
||||
public string Fingerprint { get; set; }
|
||||
}
|
||||
public class SetLogLevelPayload
|
||||
{
|
||||
public string Level { get; set; }
|
||||
}
|
||||
|
||||
public class IdentityToggleFunction : ServiceFunction
|
||||
{
|
||||
@@ -88,6 +92,19 @@ namespace ZitiDesktopEdge.ServiceClient
|
||||
public IdentityTogglePayload Payload { get; set; }
|
||||
}
|
||||
|
||||
public class SetLogLevelFunction : ServiceFunction
|
||||
{
|
||||
public SetLogLevelFunction(string level)
|
||||
{
|
||||
this.Function = "SetLogLevel";
|
||||
this.Payload = new SetLogLevelPayload()
|
||||
{
|
||||
Level = level
|
||||
};
|
||||
}
|
||||
public SetLogLevelPayload Payload { get; set; }
|
||||
}
|
||||
|
||||
public class FingerprintPayload
|
||||
{
|
||||
public string Fingerprint { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user