DotRecastNetSim/src/DotRecast.Recast.Demo/Program.cs

39 lines
1.2 KiB
C#
Raw Normal View History

2023-03-18 18:09:36 +03:00
using System.IO;
using DotRecast.Core;
2023-03-18 22:36:31 +03:00
using Serilog;
2023-03-20 18:33:17 +03:00
using Serilog.Enrichers;
2023-03-18 18:09:36 +03:00
namespace DotRecast.Recast.Demo;
public static class Program
{
public static void Main(string[] args)
{
2023-03-18 22:36:31 +03:00
2023-03-18 18:09:36 +03:00
var path = Loader.ToRPath("dungeon.obj");
path = Path.GetDirectoryName(path);
if (!string.IsNullOrEmpty(path))
{
var workingDirectory = Path.Combine(path, "..");
workingDirectory = Path.GetFullPath(workingDirectory);
Directory.SetCurrentDirectory(workingDirectory);
}
2023-04-16 05:54:50 +03:00
var format = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message:lj} [{ThreadName}:{ThreadId}]{NewLine}{Exception}";
2023-03-19 08:39:44 +03:00
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
2023-03-20 18:33:17 +03:00
.Enrich.WithThreadId()
.Enrich.WithThreadName()
.Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "main")
.WriteTo.Console(outputTemplate: format)
.WriteTo.File(
"logs/log.log",
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true,
outputTemplate: format)
2023-03-19 08:39:44 +03:00
.CreateLogger();
2023-03-20 18:33:17 +03:00
var demo = new RecastDemo();
demo.start();
}
}