private ConsoleTextColor MapLevelToConsoleColor(Domain.LogLevel level) { if (level == Domain.LogLevel.Error) { return(ConsoleTextColor.Red); } return(ConsoleTextColor.White); }
private NLog.LogLevel MapLevel(Domain.LogLevel level) { switch (level) { case Domain.LogLevel.Error: return(NLog.LogLevel.Error); } return(NLog.LogLevel.Info); }
public void Log(Domain.LogLevel level, string format, params object[] args) { // Send to hangfire var color = this.MapLevelToConsoleColor(level); this.performContext.WriteLine(color, format, args); // Persist NLog.Fluent.Log.Level(this.MapLevel(level)).Message(format, args).Write(); }