protected CommandExecutor(IResultLogger logger, string path, string exeSubpath, string exeName) { this.Logger = logger; this.PerforcePath = path; this.ExeSubpath = exeSubpath; this.ExeName = exeName; }
public RectTableLinqToSqlLoggerViewportListener(string tableName, IResultLogger<Viewport> logger, string connectionString) : base(logger, connectionString) { this.tableName = tableName; this.dc = new DbSpottedDataContext(this.connectionString); }
public TableSqlLoggerViewportListener(string tableName, string sqlScript, IResultLogger<Viewport> logger, string connectionString) : base(logger, connectionString) { this.tableName = tableName; this.sqlScript = sqlScript; }
public HServiceProvider(string serviceName, IResultLogger logger, IEnumerable <IHService> services) { _serviceName = serviceName; _logger = logger; _services = services == null ? new Collection <IHService>() : services.ToCollection(); }
public HServiceRootRunner(IHServicesProvider provider) { _provider = provider; _services = ServicesProvider.Services; _logger = ServicesProvider.Logger; _initializedByStartup = Result.SingleInfo(ServiceReasons.InitializedByStartup, Debugs.InitializedByStartup); _setByParentService = Result.SingleInfo(ServiceReasons.SetByParentService, Debugs.SetByParentService); IsInitialized = false; }
protected void LogUnhandledEngineException(Exception ex, IResultLogger logger) { TContext context = new TContext(); context.Rule = ErrorDescriptors.AnalysisHalted; // An unhandled exception was raised during analysis: {0} logger.Log(ResultKind.InternalError, context, null, nameof(SdkResources.ERR0999_UnhandledEngineException), ex.ToString()); RuntimeErrors |= RuntimeConditions.ExceptionInEngine; }
protected virtual TContext CreateContext(TOptions options, IResultLogger logger, PropertyBag policy, string filePath = null) { var context = new TContext(); context.Logger = logger; context.Policy = policy; if (filePath != null) { context.TargetUri = new Uri(filePath); } return(context); }
protected void LogExceptionCreatingLogFile(string fileName, IResultLogger logger, Exception ex) { var context = new TContext(); context.Rule = ErrorDescriptors.InvalidConfiguration; // An exception was raised attempting to create output file '{0}'. Exception information: // {1} logger.Log(ResultKind.ConfigurationError, context, null, nameof(SdkResources.ERR0997_ExceptionCreatingLogFile), fileName, ex.ToString()); RuntimeErrors |= RuntimeConditions.ExceptionCreatingLogfile; }
/// <summary> /// Validates this instance. /// </summary> public void Validate() { IEnumerable <ValidationAction> reader = QueryListReaderFactory.GetQueryListReader(); StringBuilder summary = new StringBuilder(); Parallel.ForEach(reader, currentItem => { IResultLogger logger = LoggerFactory.GetResultLogger(); logger.AssignFileName(currentItem.SourceQueryFileName + ".txt"); DataComparer comparer = new DataComparer(logger); summary.Append(Compare(comparer, currentItem)); }); IResultLogger summaryLogger = LoggerFactory.GetResultLogger(); summaryLogger.AssignFileName("Summary.txt"); summaryLogger.LogSummary(summary.ToString()); }
/// <summary> /// Adds a single logger to the collection. /// </summary> /// <param name="logger">Logger to add.</param> public Result Add(IResultLogger logger) { if (ReferenceEquals(logger, null)) { return(Result.SingleError(Errors.AddingNullLoggerToCollection)); } try { var key = logger.Id; if (LoggerSet.ContainsKey(key)) { return(Result.SingleWarning(Warnings.LoggerAlreadyExists, key)); } LoggerSet.Add(key, logger); return(Result.Success); } catch (Exception e) { return(Result.Error(e)); } }
static async Task Main(string[] args) { // configure logger string outputLog = string.Empty; if (args.Length > 1) { outputLog = args[1]; } ConfigureLog(outputLog); // get config files if (!args.Any()) { Log.Fatal("argument config filename not foud. please execute with argument filename config. ex: $ dotnet SfdcDataSync.dll RTContacts.json"); return; } string configFile = args[0]; // configure Ioc ServiceProvider serviceProvider = ConfigureIoC(); // execute job ISqlAdapter sqlAdapter = serviceProvider.GetService <ISqlAdapter>(); ISfdcAdapter sfdcAdapter = serviceProvider.GetService <ISfdcAdapter>(); IResultLogger resultLogger = serviceProvider.GetService <IResultLogger>(); JobExecutor executor = new JobExecutor(sqlAdapter, sfdcAdapter, resultLogger); try { await executor.ExecuteAsync(configFile); } catch (Exception ex) { Log.Fatal("error on executing job", ex); } }
private HashSet <ISkimmer <TContext> > CreateSkimmers(IResultLogger logger) { HashSet <ISkimmer <TContext> > result = new HashSet <ISkimmer <TContext> >(); try { IEnumerable <ISkimmer <TContext> > skimmers; skimmers = DriverUtilities.GetExports <ISkimmer <TContext> >(DefaultPlugInAssemblies); foreach (ISkimmer <TContext> skimmer in skimmers) { result.Add(skimmer); } return(result); } catch (Exception ex) { RuntimeErrors |= RuntimeConditions.ExceptionInstantiatingSkimmers; throw new ExitApplicationException <ExitReason>(SdkResources.UnexpectedApplicationExit, ex) { ExitReason = ExitReason.UnhandledExceptionInstantiatingSkimmers }; } }
public InferencingActionsModel( IProfileRepository profileRepository, ISettingsRepository settingsRepository, IDefaultSettingsProvider defaultSettingsProvider, IExpert expert, IKnowledgeBaseManager knowledgeBaseManager, IDataFilePathProvider dataFilePathProvider, IResultLogger resultLogger) { _profileRepository = profileRepository ?? throw new ArgumentNullException(nameof(profileRepository)); _settingsRepository = settingsRepository ?? throw new ArgumentNullException(nameof(settingsRepository)); _defaultSettingsProvider = defaultSettingsProvider ?? throw new ArgumentNullException(nameof(defaultSettingsProvider)); _expert = expert ?? throw new ArgumentNullException(nameof(expert)); _knowledgeBaseManager = knowledgeBaseManager ?? throw new ArgumentNullException(nameof(knowledgeBaseManager)); _dataFilePathProvider = dataFilePathProvider ?? throw new ArgumentNullException(nameof(dataFilePathProvider)); _resultLogger = resultLogger ?? throw new ArgumentNullException(nameof(resultLogger)); GetDataCommand = new RelayCommand(obj => GetData(), obj => true); StartInferenceCommand = new RelayCommand(obj => StartInference(), obj => !string.IsNullOrEmpty(DataFilePath) && SelectedProfile != null && SelectedProfile.Rules.Count != 0); GetPartialResultCommand = new RelayCommand(obj => GetPartialResult(), obj => true); OpenResultFileCommand = new RelayCommand(obj => OpenResultFile(), obj => ExpertOpinion != null); InitializeState(); }
public JobExecutor(ISqlAdapter sqlAdapter, ISfdcAdapter sfdcAdapter, IResultLogger resultLogger) { _sqlAdapter = sqlAdapter; _sfdcAdapter = sfdcAdapter; _resultLogger = resultLogger; }
public PerforceServerExecutor(IResultLogger logger, IInfoLogger infoLogger, string path, string exeSubpath) : base(logger, path, exeSubpath, PerforceServerName) { this.InfoLogger = infoLogger; }
private HashSet <string> ValidateTargetsExist(IResultLogger logger, HashSet <string> targets) { return(targets); }
public SevenZip(IResultLogger logger) : base(logger, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), string.Empty, "7z.exe") { }
public static void Error(this IResultLogger logger, string msg, params object[] args) { logger.Error(string.Format(msg, args)); }
public UxPerformanceTestContext(IResultLogger currentLogger, string unoLibraryPath) { Logger = currentLogger; UnoLibraryPath = unoLibraryPath; }
protected override TestAnalysisContext CreateContext(TestAnalyzeOptions options, IResultLogger logger, PropertyBag policy, string filePath = null) { var context = base.CreateContext(options, logger, policy, filePath); context.IsValidAnalysisTarget = options.RegardAnalysisTargetAsValid; return(context); }
public HServiceProvider(string serviceName, IResultLogger logger, params IHService[] services) : this(serviceName, logger, (IEnumerable <IHService>)services) { }
public DataComparer(IResultLogger logger) { m_logger = logger; m_findWatch = new Stopwatch(); m_compareWatch = new Stopwatch(); }
/// <summary> /// Sets a <see cref="IResultLogger"/> to be called when <see cref="Log"/> is called in debug mode. /// </summary> public static void SetLogger(IResultLogger logger) { Logger = logger; }
public UptimeMonitor(TimeSpan successWait, IPinger pinger, IResultLogger resultLogger, Action waitFunction = null) { _pinger = pinger; _resultLogger = resultLogger; _waitFunction = waitFunction ?? (() => Thread.Sleep(successWait)); }
public ResultSettingsBuilder() { // set defaults Logger = new DefaultLogger(); }
public BackupJob(IResultLogger logger, IInfoLogger infoLogger, IConfigurations configurations, string version = null) : this(new EngineManager(logger, infoLogger, configurations)) { this.version = version; }