public ILogSource CreateCustom(CustomDataSourceId id, ICustomDataSourceConfiguration configuration, out IPluginDescription pluginDescription) { var pair = _dataSourcePlugins.First(x => x.Plugin.Id == id); pluginDescription = pair.Description; var logFile = TryCreateCustomWith(pair.Plugin, configuration); return(new NoThrowLogSource(logFile, pluginDescription.Name)); }
public NoThrowCustomDataSourcePlugin(ICustomDataSourcePlugin inner) { _inner = inner; try { _name = inner.DisplayName; _id = inner.Id; } catch (Exception e) { Log.ErrorFormat("Caught unexpected exception: {0}", e); _name = inner.GetType().Name; _id = null; } }
public CustomDataSource AddCustom(CustomDataSourceId id) { CustomDataSource dataSource; var plugin = _logSourceFactory.CustomDataSources.First(x => x.Id == id); lock (_syncRoot) { var settings = new DataSource { Id = DataSourceId.CreateNew(), DisplayName = plugin.DisplayName, CustomDataSourceId = plugin.Id, CustomDataSourceConfiguration = plugin.CreateConfiguration(null) }; _settings.Add(settings); dataSource = (CustomDataSource)AddDataSource(settings); } return(dataSource); }
public ILogSource CreateCustom(CustomDataSourceId id, ICustomDataSourceConfiguration configuration) { return(CreateCustom(id, configuration, out _)); }
private void AddCustomDataSource(CustomDataSourceId id) { var dataSource = _dataSources.AddCustom(id); Add(dataSource); }