From 51ac170a226be5ab5454e65438d9c46a10dfd777 Mon Sep 17 00:00:00 2001 From: xRain Date: Mon, 28 Jun 2021 05:45:29 +0800 Subject: [PATCH] add logger --- Helpers/SimApiUtil.cs | 10 +--------- SimApiExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Helpers/SimApiUtil.cs b/Helpers/SimApiUtil.cs index a1247f6..185bf08 100644 --- a/Helpers/SimApiUtil.cs +++ b/Helpers/SimApiUtil.cs @@ -1,5 +1,4 @@ -using System; -using System.Security.Cryptography; +using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; @@ -37,12 +36,5 @@ namespace SimApi.Helpers return strbul.ToString(); } - - public static void Log(string message, string type = "Information") - { - Console.WriteLine($"[ SimApi ][ {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff")} ][ {type} ]"); - Console.WriteLine(message); - Console.WriteLine(""); - } } } \ No newline at end of file diff --git a/SimApiExtensions.cs b/SimApiExtensions.cs index 22b5803..4a742cb 100644 --- a/SimApiExtensions.cs +++ b/SimApiExtensions.cs @@ -175,7 +175,7 @@ namespace SimApi builder.ApplicationServices.GetService().AddProvider(new SimApiLoggerProvider()); } - var logger = builder.ApplicationServices.GetService(); + var logger = builder.ApplicationServices.GetService>(); if (options.EnableForwardHeaders) {