You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
5 years ago
|
using NLog;
|
||
11 years ago
|
|
||
10 years ago
|
namespace NzbDrone.Common.Instrumentation.Extensions
|
||
11 years ago
|
{
|
||
|
public static class LoggerExtensions
|
||
|
{
|
||
|
public static void ProgressInfo(this Logger logger, string message, params object[] args)
|
||
|
{
|
||
9 years ago
|
var formattedMessage = string.Format(message, args);
|
||
11 years ago
|
LogProgressMessage(logger, LogLevel.Info, formattedMessage);
|
||
|
}
|
||
|
|
||
|
public static void ProgressDebug(this Logger logger, string message, params object[] args)
|
||
|
{
|
||
9 years ago
|
var formattedMessage = string.Format(message, args);
|
||
11 years ago
|
LogProgressMessage(logger, LogLevel.Debug, formattedMessage);
|
||
|
}
|
||
|
|
||
|
public static void ProgressTrace(this Logger logger, string message, params object[] args)
|
||
|
{
|
||
9 years ago
|
var formattedMessage = string.Format(message, args);
|
||
11 years ago
|
LogProgressMessage(logger, LogLevel.Trace, formattedMessage);
|
||
|
}
|
||
|
|
||
|
private static void LogProgressMessage(Logger logger, LogLevel level, string message)
|
||
|
{
|
||
|
var logEvent = new LogEventInfo(level, logger.Name, message);
|
||
|
logEvent.Properties.Add("Status", "");
|
||
|
|
||
|
logger.Log(logEvent);
|
||
|
}
|
||
|
}
|
||
|
}
|