public static PluginLog ( String source, String str ) : void | ||
source | String | |
str | String | |
리턴 | void |
private void HandleError(ContactPluginData plugin, Exception e, PluginData.PluginDataState failed_state = PluginData.PluginDataState.DISABLED_ERROR) { Utils.PluginLog(PluginManagerName(), "Plugin \"" + plugin.contact_plugin.ProviderName() + "\" had an error Due to: " + e.Message); plugin.state = failed_state; plugin.last_error = e.Message; active_plugin = null; }
protected virtual void HandlePluginLoadException(PluginData data, Exception e) { String err = "Error creating plugin from dll \"" + data.dll + "\" of: " + e.Message; data.last_error = err; data.state = PluginData.PluginDataState.ERROR_LOADING; Utils.PluginLog(PluginManagerName(), err); }
protected override void HandlePluginLoadReflectionException(PluginData data, ReflectionTypeLoadException ex) { String err = "Error creating headset plugin from dll \"" + data.dll + "\" due to a loader exception, make sure you have the headset runtime/api/sdk installed error was:\n"; foreach (Exception e in ex.LoaderExceptions) { err += e.Message + "\n"; } data.last_error = err; data.state = PluginData.PluginDataState.ERROR_LOADING; Utils.PluginLog(PluginManagerName(), err); }
protected virtual void HandlePluginLoadReflectionException(PluginData data, ReflectionTypeLoadException ex) { String err = "Error creating plugin from dll \"" + data.dll + "\" due to a loader exception error was:\n"; foreach (Exception e in ex.LoaderExceptions) { err += e.Message + "\n"; } data.last_error = err; data.state = PluginData.PluginDataState.ERROR_LOADING; Utils.PluginLog(PluginManagerName(), err); }
private void HandleError(PluginError error, PluginData.PluginDataState failed_state = PluginData.PluginDataState.DISABLED_ERROR) { if (error.plugin == null) { error.plugin = error.device.plugin; } if ((DateTime.Now - error.plugin.last_error_time).TotalSeconds > 60 * 5) //if no errors for 5 minutes reset error count { error.plugin.error_tries_left = DEFAULT_PLUGIN_RETRIES; } error.plugin.last_error_time = DateTime.Now; error.plugin.last_error = error.exception.Message; String restart_msg = error.plugin.error_tries_left > 0 ? " will try to restart/init it " + error.plugin.error_tries_left + " more times" : " will not be restarting it"; Utils.PluginLog(PluginManagerName(), "Plugin " + error.plugin.plugin.ProviderName() + " had an error due to: " + error.exception.Message + "\n" + restart_msg); List <DeviceData> to_remove = new List <DeviceData>(); lock (devices_lock) { foreach (DeviceData device in devices) { if (device.plugin == error.plugin) { try { device.device.SetActive(false); } catch (Exception) { Utils.PluginLog(PluginManagerName(), "While handling error wasn't able to deactivate device, not a major issue"); } to_remove.Add(device); } } } lock (devices_lock) { foreach (DeviceData device in to_remove) { devices.Remove(device); } } error.plugin.plugin.Terminate(); if (error.plugin.error_tries_left-- > 0) { DelayedFunction.DelayedCall("IHeadsetPlugin_PluginStart_ " + error.plugin.plugin.ProviderName(), () => init_plugin(error.plugin), 1000); //give it a second } else { error.plugin.state = failed_state; } }
private Broker() { start_time = DateTime.Now; _instance = this; upgrade_settings(); Utils.PluginLog("", ""); //clear file headset_plugin_manager = new HeadsetPluginManager(); conference = Conference.instance; NewEvent += Call.NewFSEvent; NewEvent += Account.NewEvent; NewEvent += conference.NewFSEvent; Call.CallStateChanged += CallStateChangedHandler; init_us(); loaded(); }
public override void Dispose() { if (!disposed) { disposed = true; foreach (HeadsetPluginData plugin_data in plugins) { try { if (plugin_data.plugin != null) { plugin_data.plugin.Terminate(); } } catch (Exception e) { Utils.PluginLog("Headset Plugin Manager", "Error terminating a plugin: " + e.Message); } } } GC.SuppressFinalize(this); }
public override void Dispose() { if (!disposed) { disposed = true; foreach (ContactPluginData plugin in plugins) { try{ if (plugin.contact_plugin != null) { plugin.contact_plugin.Terminate(); } } catch (Exception e) { Utils.PluginLog(PluginManagerName(), "Error terminating a plugin: " + e.Message); } } } GC.SuppressFinalize(this); }