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.
|
|
|
|
using System.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
|
using NzbDrone.Common.Instrumentation.Sentry;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Instrumentation
|
|
|
|
|
{
|
|
|
|
|
public class InitializeLogger
|
|
|
|
|
{
|
|
|
|
|
private readonly IOsInfo _osInfo;
|
|
|
|
|
|
|
|
|
|
public InitializeLogger(IOsInfo osInfo)
|
|
|
|
|
{
|
|
|
|
|
_osInfo = osInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
var sentryTarget = LogManager.Configuration.AllTargets.OfType<SentryTarget>().FirstOrDefault();
|
|
|
|
|
if (sentryTarget != null)
|
|
|
|
|
{
|
|
|
|
|
sentryTarget.UpdateScope(_osInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|