wabbajack/Wabbajack.Common/LoggerExtensions.cs
2021-12-27 16:15:30 -07:00

20 lines
356 B
C#

using System;
using Microsoft.Extensions.Logging;
namespace Wabbajack.Common;
public static class LoggerExtensions
{
public static void CatchAndLog(this ILogger logger, Action fn)
{
try
{
fn();
}
catch (Exception ex)
{
logger.LogError(ex, "In Catch and log");
}
}
}