Skip to content

Commit 680ca40

Browse files
committed
More
1 parent 3d12729 commit 680ca40

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Epilogue.Logging.Errors;
2+
3+
public interface IErrorHandler {
4+
void Handle(Exception exception, ClassSpecificLogger logger);
5+
6+
public static IErrorHandler CrashOnError() => new CrashOnError();
7+
8+
public static IErrorHandler PrintErrorMessages() => new ErrorPrint();
9+
10+
public static LoggerDisabler Disabling(int maximumPermissableErrors) => LoggerDisabler.ForLimit(maximumPermissableErrors);
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
namespace Epilogue.Logging.Errors;
3+
4+
public class LoggerDisabler : IErrorHandler {
5+
private readonly int m_threshold;
6+
private readonly Dictionary<ClassSpecificLogger, int> m_errorCounts = [];
7+
8+
public LoggerDisabler(int threshold) {
9+
m_threshold = threshold;
10+
}
11+
12+
public static LoggerDisabler ForLimit(int threshold) => new LoggerDisabler(threshold);
13+
14+
public void Handle(Exception exception, ClassSpecificLogger logger)
15+
{
16+
throw new NotImplementedException();
17+
}
18+
}

0 commit comments

Comments
 (0)