public void Log(string message, BaseLogType baseLogType, LogLevel logLevel, LogDetails details = null, Exception ex = null, string memberName = "", string sourceFilePath = "", int sourceLineNumber = 0) { details ??= new LogDetails(); //add possible exception and info about where the log was written into the logDetails details.Add(LogMetadataFieldNames.MemberName, memberName) .Add(LogMetadataFieldNames.SourceFilePath, sourceFilePath) .Add(LogMetadataFieldNames.SourceLineNumber, sourceLineNumber); if (ex != null) { details.Add(LogMetadataFieldNames.Exception, ex); } Log(message, baseLogType, details, logLevel); }
protected abstract void Log(string message, BaseLogType logType, LogDetails details, LogLevel loglevel);
public void Fatal(string message, BaseLogType logType, LogDetails details = null, Exception ex = null, string memberName = "", string sourceFilePath = "", int sourceLineNumber = 0) { Log(message, logType, LogLevel.Fatal, details, ex, memberName, sourceFilePath, sourceLineNumber); }
public void Error(string message, BaseLogType logType, LogDetails details = null, Exception ex = null, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { Log(message, logType, LogLevel.Error, details, ex, memberName, sourceFilePath, sourceLineNumber); }