-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
465 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace DotNetHelpers.Enums | ||
{ | ||
// <summary>: | ||
// Defines logging severity levels. | ||
/// <summary> | ||
public enum LogLevel | ||
{ | ||
// <summary>: | ||
// Logs that contain the most detailed messages. These messages may contain sensitive | ||
// application data. These messages are disabled by default and should never be | ||
// enabled in a production environment. | ||
/// <summary> | ||
Trace = 0, | ||
// <summary>: | ||
// Logs that are used for interactive investigation during development. These logs | ||
// should primarily contain information useful for debugging and have no long-term | ||
// value. | ||
/// <summary> | ||
Debug = 1, | ||
// <summary>: | ||
// Logs that track the general flow of the application. These logs should have long-term | ||
// value. | ||
/// <summary> | ||
Information = 2, | ||
// <summary>: | ||
// Logs that highlight an abnormal or unexpected event in the application flow, | ||
// but do not otherwise cause the application execution to stop. | ||
/// <summary> | ||
Warning = 3, | ||
// <summary>: | ||
// Logs that highlight when the current flow of execution is stopped due to a failure. | ||
// These should indicate a failure in the current activity, not an application-wide | ||
// failure. | ||
/// <summary> | ||
Error = 4, | ||
// <summary>: | ||
// Logs that describe an unrecoverable application or system crash, or a catastrophic | ||
// failure that requires immediate attention. | ||
/// <summary> | ||
Critical = 5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace DotNetHelpers.Exceptions | ||
{ | ||
/// <summary> | ||
/// Logger Exception | ||
/// </summary> | ||
[Serializable] | ||
public class LoggerException : Exception | ||
{ | ||
/// <summary> | ||
/// Empty Constructor | ||
/// </summary> | ||
public LoggerException() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Constructor with messages | ||
/// </summary> | ||
public LoggerException(string message) : base(message) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Constructor with messages and inner exception | ||
/// </summary> | ||
public LoggerException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace DotNetHelpers.Logger | ||
{ | ||
public interface ILogService | ||
{ | ||
#region Error | ||
Task LogError(string eventId, string eventName, string message); | ||
Task LogError(string eventId, string eventName, Exception exception); | ||
Task LogError(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
|
||
#region Warning | ||
Task LogWarning(string eventId, string eventName, string message); | ||
Task LogWarning(string eventId, string eventName, Exception exception); | ||
Task LogWarning(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
|
||
#region Information | ||
Task LogInformation(string eventId, string eventName, string message); | ||
Task LogInformation(string eventId, string eventName, Exception exception); | ||
Task LogInformation(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
|
||
|
||
#region Trace | ||
Task LogTrace(string eventId, string eventName, string message); | ||
Task LogTrace(string eventId, string eventName, Exception exception); | ||
Task LogTrace(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
|
||
#region Debug | ||
Task LogDebug(string eventId, string eventName, string message); | ||
Task LogDebug(string eventId, string eventName, Exception exception); | ||
Task LogDebug(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
|
||
|
||
#region Critical | ||
Task LogCritical(string eventId, string eventName, string message); | ||
Task LogCritical(string eventId, string eventName, Exception exception); | ||
Task LogCritical(string eventId, string eventName, string message, Exception exception); | ||
#endregion | ||
} | ||
} |
Oops, something went wrong.