public static class Logger { public static void Log(string message, LogTypeEnum type) { // ... } }
public class Logger { public void LogError(Exception ex) { // ... } }
public class Logger : ILog, IAudit { public Logger(IExceptionFormatter exceptionFormatter, IStackTraceFormatter stackTraceFormatter, IClock clock, ITextWriter writer) { // ... } public void LogError(Exception ex) { // ... } }
Comments
I am stupid, what is your point with this topic?
My interpretation? Complete software over engineering
public class Logger<T> : ILog, IAudit
{
public Logger(IExceptionFormatter exceptionFormatter,
IStackTraceFormatter stackTraceFormatter,
IClock clock,
ITextWriter writer)
{
// ...
}
public void LogError(Exception ex)
{
// ...
}
public void LoggError(Expression<Action<T>> action)
{
// ...
}
}
public class Logger
{
LogTypeEnum type = LogTypeEnum.Error;
string message;
Exception ex;
public Logger Error { get { type = LogTypeEnum.Error; return this; } }
public Logger Warning { get { type = LogTypeEnum.Warning; return this; } }
public Logger Because(Exception exc) { ex = exc; return this; } }
public void Log(string message) {.....}
}