diff --git a/DesktopEdge/ServiceClient/ClientImpl.cs b/DesktopEdge/ServiceClient/ClientImpl.cs index a656335c..901c7078 100644 --- a/DesktopEdge/ServiceClient/ClientImpl.cs +++ b/DesktopEdge/ServiceClient/ClientImpl.cs @@ -24,8 +24,20 @@ using System.Windows.Documents; /// 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 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(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 diff --git a/DesktopEdge/ServiceClient/DataStructures.cs b/DesktopEdge/ServiceClient/DataStructures.cs index 2487e0a6..b49e47f8 100644 --- a/DesktopEdge/ServiceClient/DataStructures.cs +++ b/DesktopEdge/ServiceClient/DataStructures.cs @@ -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; }