Пример #1
0
        public static int Main(string[] args)
        {
            SLog.Logger = new LoggerConfiguration()
                          .MinimumLevel.Information()
                          .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
                          .Enrich.FromLogContext()
                          .WriteTo.Console()
                          .WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day)
                          .CreateLogger();

            try
            {
                SLog.Information("Starting web host");
                CreateHostBuilder(args).Build().Run();
                return(0);
            }
            catch (Exception ex)
            {
                SLog.Fatal(ex, "Host terminated unexpectedly");
                return(1);
            }
            finally
            {
                SLog.CloseAndFlush();
            }
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            ConfigureLogging();

            services.AddMvc(options => { options.EnableEndpointRouting = false; })
            .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

            services.AddCors(options =>
            {
                options.AddPolicy("AllowAnyOrigin",
                                  builder => builder.AllowAnyOrigin().AllowAnyHeader().WithMethods("GET"));
            });

            services.AddSwaggerDocument();

            Task.Factory.StartNew(
                () =>
            {
                try
                {
                    StartLoadingTransitDbs();
                }
                catch (Exception e)
                {
                    Log.Error($"PANIC: could not properly boot the server!\n{e.Message}\n{e.StackTrace}");
                }
            }
                );
        }
Пример #3
0
        static async Task <int> MainAsync(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .Enrich.FromLogContext()
                         .MinimumLevel.Information()
                         .MinimumLevel.Override("System", LogEventLevel.Information)
                         .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                         .WriteTo.Console()
                         .CreateLogger();

            try
            {
                await CreateHostBuilder(args).Build().RunAsync().ConfigureAwait(false);

                return(0);
            }
            catch (Exception ex)
            {
                Log.Logger.Fatal(ex, "Failed application");
                return(1);
            }
            finally
            {
                Log.CloseAndFlush();
            }
        }
Пример #4
0
 public Task OnExitAsync()
 {
     IsExiting = true;
     Log.CloseAndFlush();
     Container.Dispose();
     return(Task.FromResult(true));
 }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            SerilogLog.Logger = new LoggerConfiguration()
                                .MinimumLevel.ControlledBy(LevelSwitch)
                                .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                                .MinimumLevel.Override("System", LogEventLevel.Warning)
                                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                                .Enrich.FromLogContext()
                                .WriteTo.Console()
                                .CreateLogger();

            try
            {
                CreateWebHostBuilder(args)
                .Build()
                .Run();
                SerilogLog.Information("Start the web host!");
            }
            catch (System.Exception exp)
            {
                SerilogLog.Fatal(exp, "Host terminated unexpectedly");
            }
            finally
            {
                SerilogLog.Information("Ending the web host!");
                SerilogLog.CloseAndFlush();
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            var mycfg            = InitialSetup();
            var dic              = new CloudDictionary <string, string>("RoutersOnusOrense");
            var crfConnection    = GetMikrotikConnection(mycfg.CrfIp, mycfg.CrfUser, mycfg.CrfPass);
            var bridgeHostReader = crfConnection.CreateEntityReader <BridgeHost>();
            var neighReader      = crfConnection.CreateEntityReader <IpNeighbor>();
            var ponHostsMacs     = bridgeHostReader.GetAll().Where(h => h.OnInterface.Equals(mycfg.CrfOltInterface));
            var crfNeighbors     = neighReader.GetAll().Where(b => b.Interface.Equals(mycfg.CrfOltBridge));
            var hostsToCheck     = new List <string>();

            foreach (var host in ponHostsMacs)
            {
                var crfNeigh = crfNeighbors.FirstOrDefault(m => m.MacAddress.Equals(host.MacAddress));
                if (crfNeigh?.Address4 != null && !crfNeigh.Address4.Contains("10."))
                {
                    hostsToCheck.Add(crfNeigh.Address4);
                }
            }
            Log.Information("La cantidad de hosts es {cantidadHosts}", hostsToCheck.Count);

            foreach (var host in hostsToCheck)
            {
                if (dic.ContainsKey(host))
                {
                    Log.Information("La {ip} ya existe en el diccionario", host);
                }
                else
                {
                    var routerConnection = GetMikrotikConnection(host, mycfg.RouterUser, mycfg.RouterPass);
                    if (routerConnection == null)
                    {
                        continue;
                    }
                    var routerBridgeHostReader = routerConnection.CreateEntityReader <BridgeHost>();
                    var ponMac = routerBridgeHostReader.Get(h => h.MacAddress.StartsWith("E0:67"));
                    if (ponMac != null)
                    {
                        dic.Add(host, ponMac.MacAddress);
                        Log.Information("Agregada al diccionario la IP {ip} con la onu {onumac}", host, ponMac.MacAddress);
                    }
                    routerConnection.Close();
                }
            }

            //Mostrar y contar todos los elementos del diccionario persistente
            //var count = 0;
            //foreach (var word in dic)
            //{
            //    Log.Information("Cliente : {hostIp} Onu : {onuMac}", word.Key, word.Value);
            //    count++;
            //}
            //Log.Information("Cantidad de elementos en el diccionario {countdic}", count);
            //Console.ReadKey();
        }
Пример #7
0
 public Task OnExitAsync()
 {
     IsExiting = true;
     Log.CloseAndFlush();
     FinalizeDatabaseTransaction();
     Container.Dispose();
     return(Task.FromResult(true));
 }
Пример #8
0
        static void Main(string[] args)
        {
            var clusterConfiguration = new EphemeralClusterConfiguration("7.9.0");

            using var cluster = new EphemeralCluster(clusterConfiguration);

            cluster.Start(TimeSpan.FromMinutes(2));
            var uri = cluster.NodesUris().First();


            var nestIndex = "logs-from-nest";

            Announce("NEST + Elastic.CommonSchema", nestIndex);
            var settings = new ConnectionSettings(uri).EnableDebugMode();
            var client   = new ElasticClient(settings);


            var bulkAll = client.BulkAll(GetEcsEvents(10_000), b => b
                                         .Index(nestIndex)
                                         .Size(1_000)
                                         .RefreshOnCompleted()
                                         .BufferToBulk((bulk, items) => bulk.CreateMany(items))
                                         );

            bulkAll.Wait(TimeSpan.FromMinutes(2), r => Console.WriteLine("Indexed 1000 events"));

            Check(client, nestIndex);


            // Using Serilog ElasticsearchSink
            var sinkIndex = "logs-from-sink";

            Announce("Elastic.CommonSchema.Serilog", sinkIndex);
            var options = new ElasticsearchSinkOptions(uri)
            {
                CustomFormatter            = new EcsTextFormatter(),
                IndexFormat                = sinkIndex + "-{0:yyyy-MM-dd}",
                DetectElasticsearchVersion = true,
                BatchAction                = ElasticOpType.Create,
                BatchPostingLimit          = 1_000,
            };
            var logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .WriteTo.Elasticsearch(options)
                         .CreateLogger();

            Log.Logger = logger;

            foreach (var e in GetEcsEvents(10_000))
            {
                Log.Debug("Reusing {field1} by {another_field}: {message}", "some value", true, e.Message);
            }

            Log.CloseAndFlush();

            Check(client, $"{sinkIndex}-*");
        }
Пример #9
0
        public async static Task Main(string[] args)
        {
            SerilogLog.Logger = new LoggerConfiguration()
                                .MinimumLevel.ControlledBy(LevelSwitch)
                                .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                                .MinimumLevel.Override("System", LogEventLevel.Warning)
                                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                                .Enrich.FromLogContext()
                                .WriteTo.Console()
                                .WriteTo.File(
                "logs/log.txt",
                outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
                rollingInterval: RollingInterval.Day,
                retainedFileCountLimit: 7,
                rollOnFileSizeLimit: true,
                shared: true)
                                .CreateLogger();

            try
            {
                var host = CreateHostBuilder(args).Build();

                using (var scope = host.Services.CreateScope())
                {
                    var services = scope.ServiceProvider;

                    try
                    {
                        var context = services.GetRequiredService <ApplicationDbContext>();
                        context.Database.Migrate();

                        var userManager = services.GetRequiredService <UserManager <ApplicationUser> >();

                        await ApplicationDbContextSeed.SeedDefaultUserAsync(userManager);

                        await ApplicationDbContextSeed.SeedSampleDataAsync(context);
                    }
                    catch (Exception exp)
                    {
                        SerilogLog.Error(exp, "An error occurred while migrating or seeding the database.");
                    }
                }

                await host.RunAsync();
            }
            catch (System.Exception exp)
            {
                SerilogLog.Fatal(exp, "Host terminated unexpectedly");
            }
            finally
            {
                SerilogLog.Information("Ending the web host!");
                SerilogLog.CloseAndFlush();
            }
        }
Пример #10
0
        private FSharpOption <int> ConfigureMaxDocuments()
        {
            if (_maxDocuments.HasValue)
            {
                Log.Information("Processing {leaseId} in {auxContainerName} with max {changeFeedMaxDocuments} documents (<= {maxPending} pending) using {dop} processors", _leaseId, _aux.container, _maxDocuments.Value, MaxReadAhead, MaxConcurrentStreams);
                return(FSharpOption <int> .Some(_maxDocuments.Value));
            }

            Log.Information("Processing {leaseId} in {auxContainerName} without document count limit (<= {maxPending} pending) using {dop} processors", _leaseId, _aux.container, MaxReadAhead, MaxConcurrentStreams);
            return(FSharpOption <int> .None);
        }
Пример #11
0
 private async void StartGame()
 {
     try {
         if (PopupNavigation.Instance.PopupStack.Any())
         {
             await PopupNavigation.Instance.PopAsync();
         }
     } catch {
         Log.Information("JoinGamePage.StartGame: Tried to pop popup, but no popup popped");
     }
 }
Пример #12
0
        private void StartSentry()
        {
            SelfLog.Enable(m => Log.Error(m));

            Log.Logger = new LoggerConfiguration()
                         .Enrich.FromLogContext()
                         .MinimumLevel.Debug()
                         .WriteTo.Sentry(o =>
            {
                o.Dsn = new Dsn("https://[email protected]/6");
                o.MinimumEventLevel      = LogEventLevel.Error;
                o.MinimumBreadcrumbLevel = LogEventLevel.Error;
                o.AttachStacktrace       = true;
                o.SendDefaultPii         = true;
                o.Environment            = "Android: " + App.DeviceToken;
            })
                         .CreateLogger();
        }
Пример #13
0
 public static void Main(string[] args)
 {
     Log.Logger = new LoggerConfiguration()
                  .ReadFrom.Configuration(BuildConfiguration())
                  .CreateLogger();
     try
     {
         Log.Logger.Information("Getting started...");
         CreateWebHostBuilder(args).Build().Run();
     }
     catch (Exception ex)
     {
         Log.Logger.Fatal(ex, "Host terminated unexpectedly");
     }
     finally
     {
         Log.CloseAndFlush();
     }
 }
Пример #14
0
        public void Run <TMainViewModel>()
        {
            IConfiguration configuration = _configurationBuilder.Build();

            LoggerConfiguration loggerConfiguration = new LoggerConfiguration()
                                                      .ReadFrom.Configuration(configuration);

            RegisterViewAssembly <BlasticApplication>();

            Configure(x => x.RegisterInstance(configuration));
            Configure(x => x.RegisterType <TMainViewModel>());

            _containerBuilder.Populate(_serviceCollection);
            IContainer container = _containerBuilder.Build();

            LogSink logSink = container.ResolveOptional <LogSink>();

            if (logSink != null)
            {
                loggerConfiguration.WriteTo.Sink(logSink);
            }

            Log.Logger = loggerConfiguration.CreateLogger();

            Bootstrapper bootstrapper = new Bootstrapper(
                container,
                typeof(TMainViewModel),
                _viewAssemblies);

            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            try
            {
                bootstrapper.Initialize();
                _application.Run();
            }
            catch (Exception exception)
            {
                Log.Error(exception, exception.Message);
                throw;
            }
        }
Пример #15
0
        private async void Cancelled(object sender, EventArgs e)
        {
            Log.Information("EventArgs e for VisibleInvitations.CollectionChanged: {Newline}{e}", e);

            // If another game was cancelled, we don't care.  If one of two overlapping invites
            // from the same host disappeared, we also don't care.
            if (controller.VisibleInvitations.Contains(invite))
            {
                return;
            }

            WindowLabel.Text            = "Game cancelled!";
            Button.Text                 = "OK";
            ActivityIndicator.IsVisible = false;
            await Task.Delay(4000);

            if (PopupNavigation.Instance.PopupStack.Contains(this))
            {
                CancelClicked(sender, e);
            }
        }
Пример #16
0
        public static void ConfigureLogging()
        {
            var date    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            var logFile = Path.Combine("logs", $"log-itinero-{date}.txt");

            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Verbose)
                         .Enrich.FromLogContext()
                         .WriteTo.File(new JsonFormatter(), logFile)
                         .WriteTo.Console()
                         .CreateLogger();
            Log.Information($"Logging has started. Logfile can be found at {logFile}");
            Logger.LogAction = (o, level, message, parameters) =>
            {
                if (string.Equals(level, TraceEventType.Error.ToString(), StringComparison.CurrentCultureIgnoreCase))
                {
                    Log.Error($"{message}");
                }
                else if (string.Equals(level, TraceEventType.Warning.ToString(),
                                       StringComparison.CurrentCultureIgnoreCase))
                {
                    Log.Warning($"{message}");
                }
                else if (string.Equals(level, TraceEventType.Information.ToString(),
                                       StringComparison.CurrentCultureIgnoreCase))
                {
                    Log.Information($"{message}");
                }
                else if (string.Equals(level, TraceEventType.Verbose.ToString(),
                                       StringComparison.CurrentCultureIgnoreCase))
                {
                    Log.Verbose($"{message}");
                }
                else
                {
                    Log.Information($"{level} (unknown log level): {message}");
                }
            };
        }
Пример #17
0
        static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile(x =>
            {
                x.Path         = "appsettings.json";
                x.FileProvider = new EmbeddedFileProvider(typeof(Program).Assembly);
            })
                         .AddJsonFile("appsettings.json", true)
                         .Build();

            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console()
                         .ReadFrom.Configuration(config)
                         .CreateLogger();
            LogProvider.SetCurrentLogProvider(new SerilogProvider());

            using (var httpServer = new HttpServer(new HttpRequestProvider()))
            {
                var endpoint = new IPEndPoint(
                    IPAddress.Parse(config.GetValue <string>("listenAddress")),
                    config.GetValue <int>("port")
                    );
                Log.Information("Listening on {endpoint}", endpoint);

                httpServer.Use(new TcpListenerAdapter(new TcpListener(endpoint)));

                // TODO: SSL support

                httpServer.Use(new Controller(config));
                httpServer.Use(new ErrorHandler());
                httpServer.Start();
                if (!args.Contains("--test"))
                {
                    WaitForExit();
                }
                Log.Information("Exiting gracefully");
            }
        }
Пример #18
0
        public static void Main(string[] args)
        {
            Log.Logger = LogConfigurationExtensions.GetLogger();

            try
            {
                Domain.Log.Information("Starting up");
                Domain.Log.Information($"Currently running on {OsInfo.CurrentOS}");

                var host = Host.CreateDefaultBuilder(args)
                           .UseServiceProviderFactory(new AutofacServiceProviderFactory())
                           .ConfigureWebHostDefaults(webHostBuilder =>
                {
                    webHostBuilder
                    .UseContentRoot(Directory.GetCurrentDirectory())
                    .UseStartup <Startup>();
                })
                           .ConfigureLogging(config =>
                {
                    config.ClearProviders();
                    config.AddFilter(DbLoggerCategory.Database.Command.Name, LogLevel.Warning);
                })
                           .UseSerilog()
                           .Build();

                host.Run();
            }
            catch (Exception e)
            {
                Domain.Log.Fatal(e);
            }
            finally
            {
                // Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
                Log.CloseAndFlush();
            }
        }
Пример #19
0
 public void LogWarning <T>(string log)
 {
     SeriLog.ForContext <T>().Warning(log);
 }
Пример #20
0
 static ClassWithExistingField()
 {
     existingLogger = Log.ForContext <ClassWithExistingField>();
 }
Пример #21
0
 public void FromApp(Message message, SessionID sessionID)
 {
     Log.Information("Got {message}", message.ToString());
     SendFixMessages(sessionID);
 }
Пример #22
0
 public BaseApplication()
 {
     Logger = Log.ForContext(GetType());
 }
Пример #23
0
 public void Flush()
 {
     SeriLog.CloseAndFlush();
 }
Пример #24
0
        private void StartLoadingTransitDbs()
        {
            OtherModeBuilder otherModeBuilder;

            string routableTileCache = null;

            if (Configuration["RoutableTilesCache"] != null)
            {
                routableTileCache = Configuration.GetValue <string>("RoutableTilesCache");
            }

            try
            {
                otherModeBuilder = new OtherModeBuilder(routableTileCache,
                                                        Configuration.GetSection("OsmProfiles"));
            }
            catch (Exception e)
            {
                Log.Error("Could not create all the other profiles: " + e);
                otherModeBuilder = new OtherModeBuilder();
            }


            var fileLogger = new FileLogger("logs");
            var operators  = Configuration.LoadOperators();

            var state = new State(
                operators,
                otherModeBuilder,
                otherModeBuilder.RouterDb,
                fileLogger
                )
            {
                FreeMessage = "Loading transitdbs"
            };

            Log.Information("Loaded configuration");
            State.GlobalState = state;

            Log.Information("Loaded tdbs are " +
                            string.Join(", ", state.Operators.GetFullView().Operators
                                        .Select(kvp => kvp.Name)));

            state.NameIndex = new NameIndexBuilder(new List <string> {
                "name:nl", "name", "name:fr"
            })
                              .Build(state.Operators.GetFullView().GetStopsReader());


            Log.Information("Performing initial runs");
            state.FreeMessage = "Running initial data syncs";

            var allOperators = state.Operators.GetFullView();

            foreach (var provider in allOperators.Operators)
            {
                try
                {
                    Log.Information($"Starting initial run of {provider.Name}");
                    provider.Synchronizer.InitialRun();
                }
                catch (Exception e)
                {
                    Log.Error($"Caught exception while running initial data sync: {e.Message}\n{e}");
                }
            }

            foreach (var provider in allOperators.Operators)
            {
                try
                {
                    Log.Information($"Starting synchronizer for {provider.Name}");
                    provider.Synchronizer.Start();
                }
                catch (Exception e)
                {
                    Log.Error($"Caught exception while running initial data sync: {e.Message}\n{e}");
                }
            }

            state.FreeMessage = "Fully operational";
        }
Пример #25
0
 public void OnLogon(SessionID sessionID)
 {
     Log.Information("Logging on session {sessionID}", sessionID);
 }
Пример #26
0
 public void OnCreate(SessionID sessionID)
 {
     Log.Information("Creating session {sessionID}", sessionID);
 }
Пример #27
0
 public void LogError <T>(string log)
 {
     SeriLog.ForContext <T>().Error(log);
 }
Пример #28
0
 public void LogInformation <T>(string log)
 {
     SeriLog.ForContext <T>().Information(log);
 }
Пример #29
0
        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                         .Enrich.FromLogContext()
                         .WriteTo.Console()
                         .CreateLogger();


#if DEBUG
            var loggingBlacklist = new HashSet <string>();
#else
            var loggingBlacklist = new HashSet <string>();
#endif
            Logging.Logger.LogAction = (o, level, message, parameters) =>
            {
                if (loggingBlacklist.Contains(o))
                {
                    return;
                }

                if (!string.IsNullOrEmpty(o))
                {
                    message = $"[{o}] {message}";
                }

                if (level == Logging.TraceEventType.Verbose.ToString().ToLower())
                {
                    Log.Debug(message);
                }
                else if (level == Logging.TraceEventType.Information.ToString().ToLower())
                {
                    Log.Information(message);
                }
                else if (level == Logging.TraceEventType.Warning.ToString().ToLower())
                {
                    Log.Warning(message);
                }
                else if (level == Logging.TraceEventType.Critical.ToString().ToLower())
                {
                    Log.Fatal(message);
                }
                else if (level == Logging.TraceEventType.Error.ToString().ToLower())
                {
                    Log.Error(message);
                }
                else
                {
                    Log.Debug(message);
                }
            };

            // load data.
            var routerDb = BuildRouterDb.BuildOrLoad();

            // load transit db.
            var transitDb = BuildTransitDb.BuildOrLoad();

            var router = new Router(routerDb)
            {
                VerifyAllStoppable = true,
                CustomRouteBuilder = new Temp.Temp()
            };

            var antwerpen1        = new Coordinate(51.21880619138497f, 4.397792816162109f);
            var antwerpen2        = new Coordinate(51.21888683113129f, 4.432253837585449f);
            var brusselHermanTeir = new Coordinate(50.865696744357294f, 4.3497008085250854f);
            var brusselCentraal   = new Coordinate(50.83144119255431f, 4.339964389801025f);
            var lille             = new Coordinate(51.25979327802935f, 4.875869750976562f);
            var turnhout          = new Coordinate(51.3202332109125f, 4.9339234828948975f);
            var tourEnTaxis       = new Coordinate(50.86439661723841f, 4.348719120025635f);
            var marcheEnFamenne   = new Coordinate(50.23142236000259f, 5.333776473999023f);
            var ieper             = new Coordinate(50.85532180383167f, 2.860565185546875f);
//
//            var route = router.Calculate(router.Db.GetSupportedProfile("pedestrian.shortcut"),
//                antwerpen1, antwerpen2);
//            File.WriteAllText("route-antwerpen.json", route.ToGeoJson());
//
//            route = router.Calculate(router.Db.GetSupportedProfile("pedestrian.shortcut"),
//                brusselHermanTeir, brusselCentraal);
//            File.WriteAllText("route-brussel.json", route.ToGeoJson());
//

            var sourceLocation = antwerpen2;
            var targetLocation = brusselHermanTeir;

            var routeResult = router.TryCalculateIntermodal(transitDb, router.Db.GetSupportedProfile("pedestrian"),
                                                            sourceLocation, targetLocation);
            File.WriteAllText("intermodal-route1.json", routeResult.Value.ToGeoJson());

            routeResult = router.TryCalculateIntermodal(transitDb, router.Db.GetSupportedProfile("pedestrian"),
                                                        antwerpen2, lille);
            File.WriteAllText("intermodal-route2.json", routeResult.Value.ToGeoJson());

            routeResult = router.TryCalculateIntermodal(transitDb, router.Db.GetSupportedProfile("pedestrian"),
                                                        turnhout, lille);
            File.WriteAllText("intermodal-route3.json", routeResult.Value.ToGeoJson());

            routeResult = router.TryCalculateIntermodal(transitDb, router.Db.GetSupportedProfile("pedestrian"),
                                                        turnhout, marcheEnFamenne);
            File.WriteAllText("intermodal-route4.json", routeResult.Value.ToGeoJson());

            routeResult = router.TryCalculateIntermodal(transitDb, router.Db.GetSupportedProfile("pedestrian"),
                                                        turnhout, ieper);
            File.WriteAllText("intermodal-route5.json", routeResult.Value.ToGeoJson());
        }
Пример #30
0
 public Task Handle(IHttpContext context, Func <Task> next)
 {
     Log.Information("Not found: {0}", context.Request.Uri);
     context.Response = new HttpResponse(HttpResponseCode.NotFound, "", true);
     return(Task.CompletedTask);
 }