コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 public static void StartLogHandler(ButtplugLogLevel aMaxLevel, bool aUseJSON)
 {
     Console.WriteLine(aMaxLevel.ToString());
     ButtplugFFILogCalls.buttplug_add_log_handler(LogCallback, aMaxLevel.ToString(), aUseJSON);
 }
コード例 #3
0
 private static void ActivateEnvLogger()
 {
     ButtplugFFILogCalls.buttplug_activate_env_logger();
 }
コード例 #4
0
 private static void ActivateEnvLogger()
 {
     ButtplugFFILogCalls.ButtplugActivateEnvLogger();
 }
コード例 #5
0
 protected override bool ReleaseHandle()
 {
     Console.WriteLine("Releasing handle?!");
     ButtplugFFILogCalls.ButtplugFreeLogHandle(handle);
     return(true);
 }