public static void SetLogOptions(ButtplugLogLevel aMaxLevel, bool aUseJSON)
        {
            if (aMaxLevel != ButtplugLogLevel.Off)
            {
                if (_logHandleSet)
                {
                    throw new InvalidOperationException("Cannot set logging options twice (this is a bug, will be fixed at some point, see https://github.com/buttplugio/b******g-rs-ffi/issues/23).");
                }

                _logHandle    = ButtplugFFILogCalls.ButtplugCreateLogHandle(_logCallback, IntPtr.Zero, aMaxLevel.ToString(), aUseJSON);
                _logHandleSet = true;
            }
            else
            {
                if (_logHandle != null)
                {
                    _logHandle.Dispose();
                    _logHandle = null;
                }
            }
        }
 public static void StartLogHandler(ButtplugLogLevel aMaxLevel, bool aUseJSON)
 {
     Console.WriteLine(aMaxLevel.ToString());
     ButtplugFFILogCalls.buttplug_add_log_handler(LogCallback, aMaxLevel.ToString(), aUseJSON);
 }
 private static void ActivateEnvLogger()
 {
     ButtplugFFILogCalls.buttplug_activate_env_logger();
 }
 private static void ActivateEnvLogger()
 {
     ButtplugFFILogCalls.ButtplugActivateEnvLogger();
 }
 protected override bool ReleaseHandle()
 {
     Console.WriteLine("Releasing handle?!");
     ButtplugFFILogCalls.ButtplugFreeLogHandle(handle);
     return(true);
 }