2024-10-30 21:32:16 +09:00
|
|
|
|
using BitgetApi.Data;
|
|
|
|
|
|
using DevExpress.Data.Localization;
|
|
|
|
|
|
using Serilog.Events;
|
|
|
|
|
|
using Serilog;
|
|
|
|
|
|
using System;
|
2024-05-22 16:56:51 +09:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
2024-10-30 21:32:16 +09:00
|
|
|
|
using System.IO;
|
2024-05-22 16:56:51 +09:00
|
|
|
|
|
2024-05-23 16:32:30 +09:00
|
|
|
|
namespace BitgetAPI
|
2024-05-22 16:56:51 +09:00
|
|
|
|
{
|
|
|
|
|
|
internal static class Program
|
|
|
|
|
|
{
|
2024-10-30 21:32:16 +09:00
|
|
|
|
static GlobalOptions globalOptions = GlobalOptions.Instance;
|
2024-05-22 16:56:51 +09:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 해당 애플리케이션의 주 진입점입니다.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[STAThread]
|
|
|
|
|
|
static void Main()
|
|
|
|
|
|
{
|
2024-10-30 21:32:16 +09:00
|
|
|
|
var outputTemp = "{Timestamp:u} {Level:u4} {Message:lj}{NewLine}{Exception}";
|
|
|
|
|
|
|
|
|
|
|
|
//globalOptions.logDir
|
2024-11-02 19:52:27 +09:00
|
|
|
|
var temp = new LoggerConfiguration().MinimumLevel.Override("Microsoft", LogEventLevel.Warning);
|
2024-10-30 21:32:16 +09:00
|
|
|
|
temp = globalOptions.LogDebugWrite ? temp.MinimumLevel.Debug() : temp.MinimumLevel.Information();
|
|
|
|
|
|
Log.Logger = temp
|
|
|
|
|
|
.WriteTo.Map(
|
|
|
|
|
|
e => DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
|
|
|
(v, wt) => wt
|
|
|
|
|
|
.File(Path.Combine(globalOptions.logDir, $"BitgetApi_{v}.log"),
|
|
|
|
|
|
outputTemplate: outputTemp)
|
|
|
|
|
|
)
|
|
|
|
|
|
.CreateLogger();
|
|
|
|
|
|
Log.Information("테스트");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new Exception("에러테스트 확인용");
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
Log.Error(ex,"에러 테스트");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-22 16:56:51 +09:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
|
|
Application.Run(new MainForm());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|