Ejemplo n.º 1
0
        protected override async void OnInitialized()
        {
            InitializeComponent();

            LoggerService = Container.Resolve <ILoggerService>();
            LoggerService.StartMethod();
            LogFileService = Container.Resolve <ILogFileService>();
            LogFileService.AddSkipBackupAttribute();

            // Local Notification tap event listener
            //NotificationCenter.Current.NotificationTapped += OnNotificationTapped;
            LogUnobservedTaskExceptions();

            INavigationResult result = await NavigationService.NavigateAsync("/" + nameof(SplashPage));

            if (!result.Success)
            {
                LoggerService.Info($"Failed transition.");

                MainPage = new ExceptionPage
                {
                    BindingContext = new ExceptionPageViewModel()
                    {
                        Message = result.Exception.Message
                    }
                };
                System.Diagnostics.Debugger.Break();
            }

            LoggerService.EndMethod();
        }
Ejemplo n.º 2
0
 public GitFileLogHostedService(ILaobianLogQueue logQueue, ILogFileService fileRepository,
                                IHostApplicationLifetime applicationLifetime)
 {
     _logQueue       = logQueue;
     _fileRepository = fileRepository;
     applicationLifetime.ApplicationStarted.Register(() => _readyToRun = true);
 }
Ejemplo n.º 3
0
 public LogGrpcService(ILogger <LogGrpcService> logger, ILaobianLogQueue laobianLogQueue,
                       ILogFileService logFileService)
 {
     _logger          = logger;
     _logFileService  = logFileService;
     _laobianLogQueue = laobianLogQueue;
 }
Ejemplo n.º 4
0
 public SettingsPageViewModel(
     INavigationService navigationService,
     ILoggerService loggerService,
     IUserDataRepository userDataRepository,
     IExposureDataRepository exposureDataRepository,
     IExposureConfigurationRepository exposureConfigurationRepository,
     ISendEventLogStateRepository sendEventLogStateRepository,
     IEventLogRepository eventLogRepository,
     ILogFileService logFileService,
     AbsExposureNotificationApiService exposureNotificationApiService,
     ICloseApplicationService closeApplicationService,
     IEssentialsService essentialsService
     ) : base(navigationService)
 {
     Title                                = AppResources.SettingsPageTitle;
     AppVer                               = essentialsService.AppVersion;
     this.loggerService                   = loggerService;
     this.userDataRepository              = userDataRepository;
     this.exposureDataRepository          = exposureDataRepository;
     this.exposureConfigurationRepository = exposureConfigurationRepository;
     _sendEventLogStateRepository         = sendEventLogStateRepository;
     _eventLogRepository                  = eventLogRepository;
     this.logFileService                  = logFileService;
     this.exposureNotificationApiService  = exposureNotificationApiService;
     this.closeApplicationService         = closeApplicationService;
 }
Ejemplo n.º 5
0
        public LogPeriodicDeleteReceiver()
        {
            var essensialService = new EssentialsService();
            var logPathService   = new LogPathService(new LogPathServiceAndroid());

            loggerService  = new LoggerService(logPathService, essensialService);
            logFileService = new Covid19Radar.Services.Logs.LogFileService(loggerService, logPathService);
        }
Ejemplo n.º 6
0
 public LogPeriodicDeleteService(
     ILoggerService loggerService,
     ILogFileService logFileService
     )
 {
     this.loggerService  = loggerService;
     this.logFileService = logFileService;
 }
Ejemplo n.º 7
0
 public SettingsPageViewModel(INavigationService navigationService, ILoggerService loggerService, IUserDataService userDataService, ExposureNotificationService exposureNotificationService, ILogFileService logFileService) : base(navigationService, exposureNotificationService)
 {
     Title                            = AppResources.SettingsPageTitle;
     AppVer                           = AppInfo.VersionString;// AppSettings.Instance.AppVersion;
     this.loggerService               = loggerService;
     this.userDataService             = userDataService;
     _UserData                        = this.userDataService.Get();
     this.exposureNotificationService = exposureNotificationService;
     this.logFileService              = logFileService;
 }
Ejemplo n.º 8
0
        public void RefreshAppliedRules()
        {
            _refreshTimer.Stop();

            ILogFileService logFileService = Mvx.Resolve <ILogFileService>();

            if (logFileService.CurrentLogFile != null)
            {
                CheckRules(logFileService.CurrentLogFile.Lines);
            }
        }
 public SettingsPageViewModel(INavigationService navigationService, ILoggerService loggerService, IUserDataService userDataService, IHttpDataService httpDataService, IExposureNotificationService exposureNotificationService, ILogFileService logFileService, ITermsUpdateService termsUpdateService) : base(navigationService)
 {
     Title                            = AppResources.SettingsPageTitle;
     AppVer                           = AppInfo.VersionString;
     this.loggerService               = loggerService;
     this.userDataService             = userDataService;
     this.httpDataService             = httpDataService;
     this.exposureNotificationService = exposureNotificationService;
     this.logFileService              = logFileService;
     this.termsUpdateService          = termsUpdateService;
 }
Ejemplo n.º 10
0
 public SendLogConfirmationPageViewModel(
     INavigationService navigationService,
     ILogFileService logFileService,
     ILoggerService loggerService,
     ILogUploadService logUploadService,
     ILogPathService logPathService) : base(navigationService)
 {
     this.loggerService    = loggerService;
     this.logFileService   = logFileService;
     this.logUploadService = logUploadService;
     this.logPathService   = logPathService;
 }
Ejemplo n.º 11
0
 public InqueryPageViewModel(
     INavigationService navigationService,
     ILoggerService loggerService,
     ILogFileService logFileService,
     ILogPathService logPathService,
     IEssentialsService essentialsService
     ) : base(navigationService)
 {
     Title = AppResources.InqueryPageTitle;
     this.loggerService     = loggerService;
     this.logFileService    = logFileService;
     this.logPathService    = logPathService;
     this.essentialsService = essentialsService;
 }
Ejemplo n.º 12
0
        protected override void OnInitialized()
        {
            InitializeComponent();

            LoggerService = Container.Resolve <ILoggerService>();
            LoggerService.StartMethod();
            LogFileService = Container.Resolve <ILogFileService>();
            LogFileService.SetSkipBackupAttributeToLogDir();

            LogUnobservedTaskExceptions();

            FirstLoad = false;

            LoggerService.EndMethod();
        }
Ejemplo n.º 13
0
        protected override async void OnInitialized()
        {
            InitializeComponent();

            LoggerService = Container.Resolve <ILoggerService>();
            LoggerService.StartMethod();
            LogFileService = Container.Resolve <ILogFileService>();
            LogFileService.AddSkipBackupAttribute();

#if USE_MOCK
            // For debug mode, set the mock api provider to interact
            // with some fake data
            Xamarin.ExposureNotifications.ExposureNotification.OverrideNativeImplementation(new Services.TestNativeImplementation());
#endif
            Xamarin.ExposureNotifications.ExposureNotification.Init();

            // var enabled = await Xamarin.ExposureNotifications.ExposureNotification.IsEnabledAsync();
            // App.LoggerService.Info($"IsEnabledAsync is {enabled}");

            // Local Notification tap event listener
            //NotificationCenter.Current.NotificationTapped += OnNotificationTapped;
            LogUnobservedTaskExceptions();

            INavigationResult result = await NavigationService.NavigateAsync("/" + nameof(SplashPage));

            if (!result.Success)
            {
                LoggerService.Info($"Failed transition.");

                MainPage = new ExceptionPage
                {
                    BindingContext = new ExceptionPageViewModel()
                    {
                        Message = result.Exception.Message
                    }
                };
                System.Diagnostics.Debugger.Break();
            }

            LoggerService.EndMethod();
        }
Ejemplo n.º 14
0
 public SettingsPageViewModel(
     INavigationService navigationService,
     ILoggerService loggerService,
     IUserDataRepository userDataRepository,
     IExposureDataRepository exposureDataRepository,
     IExposureConfigurationRepository exposureConfigurationRepository,
     ILogFileService logFileService,
     AbsExposureNotificationApiService exposureNotificationApiService,
     ICloseApplicationService closeApplicationService
     ) : base(navigationService)
 {
     Title                                = AppResources.SettingsPageTitle;
     AppVer                               = AppInfo.VersionString;
     this.loggerService                   = loggerService;
     this.userDataRepository              = userDataRepository;
     this.exposureDataRepository          = exposureDataRepository;
     this.exposureConfigurationRepository = exposureConfigurationRepository;
     this.logFileService                  = logFileService;
     this.exposureNotificationApiService  = exposureNotificationApiService;
     this.closeApplicationService         = closeApplicationService;
 }
Ejemplo n.º 15
0
 public FileLogSink(IFileSystemService fileSystemService, ILogFormatterService logFormatterService, ILogFileService logFileService)
 {
     _fileSystemService   = fileSystemService ?? throw new ArgumentNullException(nameof(fileSystemService));
     _logFormatterService = logFormatterService ?? throw new ArgumentNullException(nameof(logFormatterService));
     _logFileService      = logFileService ?? throw new ArgumentNullException(nameof(logFileService));
 }
Ejemplo n.º 16
0
 public LogController(ILogFileService logFileService)
 {
     _logFileService = logFileService ?? throw new System.ArgumentNullException(nameof(logFileService));
 }
Ejemplo n.º 17
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IWebHostEnvironment env,
                              ILogService logService,
                              ILogMessageFactory logMessageFactory,
                              IConnectionProvider connectionProvider,
                              IMqttRepository repository,
                              IMqttCommandAdapter commandAdapter,
                              IAdapterSettingService adapterSettingService,
                              IUiConfigurationService uiConfigurationService,
                              INotificationService notificationService,
                              ISettingsService settingsService,
                              IFileSystemService fileSystemService,
                              ILogFormatterService logFormatterService,
                              ILogFileService logFileService,
                              ISettingsProvider settingsProvider)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            settingsProvider.ReadSettings();

            logService.RegisterSinks(new List <IlogSink>
            {
                new ConsoleLogSink(),
                new MemoryLogSink(logMessageFactory, notificationService),
                new FileLogSink(fileSystemService, logFormatterService, logFileService)
            });

            if (Debugger.IsAttached)
            {
                logService.RegisterSink(new DebugLogSink());
            }

            logService.Log(LogSeverity.Info, "Logging started.");

            var repo = new DatabaseRepository();

            repo.InitializeDatabase();

            commandAdapter.Initialize();
            connectionProvider.InitializeConnection();
            repository.Initialize();
            adapterSettingService.Initialize();
            uiConfigurationService.ReadAllConfigurationFiles();

            ConfigureSystemSpecifics(app.ApplicationServices);
            app.ApplicationServices.GetService <ICustomCommandConfigurationService>().ReloadConfiguration();
        }
Ejemplo n.º 18
0
 public MainViewModel(ILogFileService logService, IOpenFileService fileService)
 {
     _logService  = logService;
     _fileService = fileService;
 }
Ejemplo n.º 19
0
 public MyLogger(ILogDatabaseService databaseService, ILogFileService fileService, ILogConsoleService consoleService)
 {
     _databaseService = databaseService;
     _fileService = fileService;
     _consoleService = consoleService;
 }
Ejemplo n.º 20
0
 public LogFilesViewModel(IWebSevices web, IUserSettings settings, IConnection con, ILogFileService log) : base(settings, web, con)
 {
     logService = log;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScriptLoggerController"/> class.
 /// </summary>
 /// <param name="logFileService">The log file service.</param>
 public ScriptLoggerController(ILogFileService logFileService)
 {
     this.logFileService = logFileService;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Initialization injection ILogFileService via DI
 /// </summary>
 /// <param name="logFileService"></param>
 public CalculationController(ILogFileService logFileService)
 {
     _logFileService = logFileService;
 }
Ejemplo n.º 23
0
 public LogFileParser(LogItemParser itemParser, IFileReader fileReader, ILogFileService fileService)
 {
     ItemParser  = itemParser ?? throw new System.ArgumentNullException(nameof(itemParser));
     FileReader  = fileReader ?? throw new System.ArgumentNullException(nameof(fileReader));
     FileService = fileService;
 }
Ejemplo n.º 24
0
 public LogFileApi(ILogFileService logFileService)
 {
     _logFileService = logFileService;
 }
Ejemplo n.º 25
0
 public CalculationControllerTests()
 {
     _logService = new Mock <ILogFileService>().Object;
 }
Ejemplo n.º 26
0
 public LogPeriodicDeleteServiceIos()
 {
     loggerService  = DependencyService.Resolve <ILoggerService>();
     logFileService = DependencyService.Resolve <ILogFileService>();
 }
Ejemplo n.º 27
0
        protected override async void OnInitialized()
        {
            InitializeComponent();

            LoggerService = Container.Resolve <ILoggerService>();
            LoggerService.StartMethod();
            LogFileService = Container.Resolve <ILogFileService>();
            LogFileService.AddSkipBackupAttribute();

#if USE_MOCK
            // For debug mode, set the mock api provider to interact
            // with some fake data
            Xamarin.ExposureNotifications.ExposureNotification.OverrideNativeImplementation(new Services.TestNativeImplementation());
#endif
            Xamarin.ExposureNotifications.ExposureNotification.Init();

            // Local Notification tap event listener
            //NotificationCenter.Current.NotificationTapped += OnNotificationTapped;
            LogUnobservedTaskExceptions();

            INavigationResult result;
            // Check user data and skip tutorial
            IUserDataService userDataService = Container.Resolve <IUserDataService>();

            if (userDataService.IsExistUserData)
            {
                LoggerService.Info("User data exists");
                var userData = userDataService.Get();
                LoggerService.Info($"userData.IsOptined: {userData.IsOptined}");
                LoggerService.Info($"userData.IsPolicyAccepted: {userData.IsPolicyAccepted}");
                if (userData.IsOptined && userData.IsPolicyAccepted)
                {
                    LoggerService.Info($"Transition to SplashPage");
                    result = await NavigationService.NavigateAsync("/" + nameof(SplashPage));
                }
                else
                {
                    LoggerService.Info($"Transition to TutorialPage1");
                    result = await NavigationService.NavigateAsync("/" + nameof(TutorialPage1));
                }
            }
            else
            {
                LoggerService.Info("No user data exists");
                LoggerService.Info($"Transition to TutorialPage1");
                result = await NavigationService.NavigateAsync("/" + nameof(TutorialPage1));
            }

            if (!result.Success)
            {
                LoggerService.Info($"Failed transition.");

                MainPage = new ExceptionPage
                {
                    BindingContext = new ExceptionPageViewModel()
                    {
                        Message = result.Exception.Message
                    }
                };
                System.Diagnostics.Debugger.Break();
            }

            LoggerService.EndMethod();
        }
Ejemplo n.º 28
0
 public StatusBarViewModel(ILogFileService logService)
 {
     _logService = logService;
     logService.LogFileChanged += logService_LogFileChanged;
     CurrentLog = logService.CurrentLogFile;
 }
Ejemplo n.º 29
0
 public DeleteOldLogsOperation(ILoggerService loggerService, ILogFileService logFileService)
 {
     this.loggerService  = loggerService;
     this.logFileService = logFileService;
 }