-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Epilogue.Logging.Errors; | ||
|
||
public interface IErrorHandler { | ||
void Handle(Exception exception, ClassSpecificLogger logger); | ||
|
||
public static IErrorHandler CrashOnError() => new CrashOnError(); | ||
|
||
public static IErrorHandler PrintErrorMessages() => new ErrorPrint(); | ||
|
||
public static LoggerDisabler Disabling(int maximumPermissableErrors) => LoggerDisabler.ForLimit(maximumPermissableErrors); | ||
} |
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,18 @@ | ||
|
||
namespace Epilogue.Logging.Errors; | ||
|
||
public class LoggerDisabler : IErrorHandler { | ||
private readonly int m_threshold; | ||
private readonly Dictionary<ClassSpecificLogger, int> m_errorCounts = []; | ||
|
||
public LoggerDisabler(int threshold) { | ||
m_threshold = threshold; | ||
} | ||
|
||
public static LoggerDisabler ForLimit(int threshold) => new LoggerDisabler(threshold); | ||
|
||
public void Handle(Exception exception, ClassSpecificLogger logger) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |