From ecfd5e2f59599e27d343407174bdfcbb5003dedd Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 6 Apr 2019 15:39:21 +0200 Subject: [PATCH] Aggiunta classe log NUOVE (come Logging...) --- SteamWareLib/Logging.cs | 31 +++++++++++++++++++++++++++++++ SteamWareLib/SteamWare.csproj | 7 +++++++ SteamWareLib/packages.config | 1 + 3 files changed, 39 insertions(+) create mode 100644 SteamWareLib/Logging.cs diff --git a/SteamWareLib/Logging.cs b/SteamWareLib/Logging.cs new file mode 100644 index 0000000..47daf61 --- /dev/null +++ b/SteamWareLib/Logging.cs @@ -0,0 +1,31 @@ +using NLog; +using NLog.Config; +using NLog.Targets; + +namespace MConnectSDK +{ + internal static class Log + { + public static Logger Instance { get; private set; } + static Log() + { +#if DEBUG + // Setup the logging view for Sentinel - http://sentinel.codeplex.com + var sentinalTarget = new NLogViewerTarget() + { + Name = "sentinal", + Address = "udp://127.0.0.1:9999", + IncludeNLogData = false + }; + var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget); + LogManager.Configuration.AddTarget("sentinal", sentinalTarget); + LogManager.Configuration.LoggingRules.Add(sentinalRule); + +#endif + + LogManager.ReconfigExistingLoggers(); + + Instance = LogManager.GetCurrentClassLogger(); + } + } +} \ No newline at end of file diff --git a/SteamWareLib/SteamWare.csproj b/SteamWareLib/SteamWare.csproj index 8f93621..520c6b5 100644 --- a/SteamWareLib/SteamWare.csproj +++ b/SteamWareLib/SteamWare.csproj @@ -78,6 +78,9 @@ ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + + ..\..\MoonPro_dotnet\packages\NLog.4.6.2\lib\net45\NLog.dll + ..\packages\Pipelines.Sockets.Unofficial.1.0.9\lib\net461\Pipelines.Sockets.Unofficial.dll @@ -90,6 +93,7 @@ ..\..\GMW\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + 3.5 @@ -115,12 +119,15 @@ ..\..\GMW\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + ..\..\GMW\packages\System.Threading.Channels.4.5.0\lib\netstandard2.0\System.Threading.Channels.dll ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/SteamWareLib/packages.config b/SteamWareLib/packages.config index 94b0b80..1ab4e60 100644 --- a/SteamWareLib/packages.config +++ b/SteamWareLib/packages.config @@ -3,6 +3,7 @@ +