Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobric committed Sep 19, 2017
2 parents afc05c1 + e24e68d commit 3964197
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 5 deletions.
67 changes: 63 additions & 4 deletions Daenet.Common.Logging/LogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public string SourceName
#endregion

#region Constructors & Deconstructor

/// <summary>
/// Creates the instance of the logging manager.
/// Default source is "Daenet.Diagnostics.Source"
Expand Down Expand Up @@ -177,11 +178,25 @@ public void Close()
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
[Obsolete("Use TraceMessage(int eventId, string msg, params object[] myParams) instead.", false)]
public void TraceMessage(TracingLevel traceLevel, int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Information, LogLevel.Information, eventId, null, msg, myParams);
}

/// <summary>
/// The Method traces a message.
/// </summary>
/// <param name="eventId">The event id to identifiy a specific event..</param>
/// <param name="msg">The message to trace. The message can contains format placeholders, which are
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
public void TraceMessage(int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Information, LogLevel.Information, eventId, null, msg, myParams);
}


/// <summary>
/// The Method traces a error which is occured in the application.
Expand All @@ -192,11 +207,25 @@ public void TraceMessage(TracingLevel traceLevel, int eventId, string msg, param
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
[Obsolete("Use TraceError(int eventId, string msg, params object[] myParams) instead.", false)]
public void TraceError(TracingLevel traceLevel, int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Error, LogLevel.Error, eventId, null, msg, myParams);
}

/// <summary>
/// The Method traces a error which is occured in the application.
/// </summary>
/// <param name="eventId">The event id to identifiy a specific event..</param>
/// <param name="msg">The message to trace. The message can contains format placeholders, which are
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
public void TraceError(int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Error, LogLevel.Error, eventId, null, msg, myParams);
}

/// <summary>
/// The Method traces a error which is occured in the application.
/// The Error contain an exception.
Expand All @@ -208,11 +237,27 @@ public void TraceError(TracingLevel traceLevel, int eventId, string msg, params
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
[Obsolete("Use TraceError(int eventId, Exception err, string msg, params object[] myParams) instead.", false)]
public void TraceError(TracingLevel traceLevel, int eventId, Exception err, string msg, params object[] myParams)
{
trace(TraceEventType.Error, LogLevel.Error, eventId, err, msg, myParams);
}

/// <summary>
/// The Method traces a error which is occured in the application.
/// The Error contain an exception.
/// </summary>
/// <param name="eventId">The event id to identifiy a specific event..</param>
/// <param name="err">The Error exception.</param>
/// <param name="msg">The message to trace. The message can contains format placeholders, which are
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
public void TraceError(int eventId, Exception err, string msg, params object[] myParams)
{
trace(TraceEventType.Error, LogLevel.Error, eventId, err, msg, myParams);
}

/// <summary>
/// The Method traces a warning which is occured in the application.
/// </summary>
Expand All @@ -222,11 +267,25 @@ public void TraceError(TracingLevel traceLevel, int eventId, Exception err, stri
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
[Obsolete("Use TraceWarning(int eventId, string msg, params object[] myParams) instead.", false)]
public void TraceWarning(TracingLevel traceLevel, int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Warning, LogLevel.Warning, eventId, null, msg, myParams);
}

/// <summary>
/// The Method traces a warning which is occured in the application.
/// </summary>
/// <param name="eventId">The event id to identifiy a specific event..</param>
/// <param name="msg">The message to trace. The message can contains format placeholders, which are
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
/// <exception cref="Daenet.LogManagerException">If a log exception is thrown.</exception>
public void TraceWarning(int eventId, string msg, params object[] myParams)
{
trace(TraceEventType.Warning, LogLevel.Warning, eventId, null, msg, myParams);
}

/// <summary>
/// The method traces a Debug message.
/// </summary>
Expand Down Expand Up @@ -268,10 +327,10 @@ public void TraceCritical(int eventId, Exception err, string msg, params object[
/// <summary>
/// Trace the message in the trace source.
/// </summary>
/// <param name="traceEvent">The tace event which is occured.</param>
/// <param name="traceEvent">The trace event which is occurred.</param>
/// <param name="logLevel">The Trace level for this message.</param>
/// <param name="eventId">The event id to identifiy a specific event.</param>
/// <param name="exception">The excetion which is thrown.</param>
/// <param name="eventId">The event id to identify a specific event.</param>
/// <param name="exception">The exception which is thrown.</param>
/// <param name="msg">The message to trace. The message can contains format placeholders, which are
/// filled with the parameters.</param>
/// <param name="myParams">The Parameters to fill the message.</param>
Expand Down Expand Up @@ -341,7 +400,7 @@ private LogLevel mapToLogLevel(TracingLevel traceLevel)
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// runtime from inside the finalize and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">Specifies whether to dispose all managed resources.</param>
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Daenet.Common.Logging
# Daenet.Common.Logging
This is a wrapper for the .net core ILogger. The `LogManager` class wraps the ILogger interface and has all the functions `ILogger` provides and more. See **LogManager**.

## Installation
Install the Daenet.Common.Logging [Nuget package](https://www.nuget.org/packages/Daenet.Common.Logging/).

## LogManager

0 comments on commit 3964197

Please sign in to comment.