diff --git a/SteamWare.IO/Logging.cs b/SteamWare.IO/Logging.cs new file mode 100644 index 0000000..de5d661 --- /dev/null +++ b/SteamWare.IO/Logging.cs @@ -0,0 +1,37 @@ +using NLog; +using NLog.Config; +using NLog.Targets; + +namespace SteamWare.IO +{ + /// + /// Classe helper x LOG basata su NLog + /// + public static class Logging + { + /// + /// S + /// + public static NLog.Logger Instance { get; private set; } + static Logging() + { +#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(); + } + } +} diff --git a/SteamWare.IO/SteamWare.IO.csproj b/SteamWare.IO/SteamWare.IO.csproj index d0a7e55..f8ee192 100644 --- a/SteamWare.IO/SteamWare.IO.csproj +++ b/SteamWare.IO/SteamWare.IO.csproj @@ -62,6 +62,7 @@ DataLayer_generic.xsd + @@ -70,12 +71,6 @@ Settings.settings - - - {97a9f482-c173-4f0f-9f8f-7bb41c59cdd6} - SteamWare.Logger - - diff --git a/SteamWare.IO/fileMover.cs b/SteamWare.IO/fileMover.cs index d69d39e..3845bf4 100644 --- a/SteamWare.IO/fileMover.cs +++ b/SteamWare.IO/fileMover.cs @@ -1,5 +1,4 @@ using ICSharpCode.SharpZipLib.Zip; -using SteamWare.Logger; using System; using System.Diagnostics; using System.IO; diff --git a/SteamWare.Logger/SteamWare.Logger.csproj b/SteamWare.Logger/SteamWare.Logger.csproj index 658161c..6863627 100644 --- a/SteamWare.Logger/SteamWare.Logger.csproj +++ b/SteamWare.Logger/SteamWare.Logger.csproj @@ -62,9 +62,7 @@ - - - +