mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix some log creation issues and tests
This commit is contained in:
parent
46a24d9268
commit
558886e0ed
@ -50,7 +50,10 @@ namespace Wabbajack
|
||||
{
|
||||
var config = new NLog.Config.LoggingConfiguration();
|
||||
|
||||
var logFolder = KnownFolders.LauncherAwarePath;
|
||||
var logFolder = KnownFolders.LauncherAwarePath.Combine("logs");
|
||||
if (!logFolder.DirectoryExists())
|
||||
logFolder.CreateDirectory();
|
||||
|
||||
var fileTarget = new FileTarget("file")
|
||||
{
|
||||
FileName = logFolder.Combine("Wabbajack.current.log").ToString(),
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Wabbajack.DTOs.Interventions;
|
||||
using Wabbajack.Services.OSIntegrated;
|
||||
using Xunit.DependencyInjection;
|
||||
using Xunit.DependencyInjection.Logging;
|
||||
@ -10,6 +11,7 @@ public class Startup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection service)
|
||||
{
|
||||
service.AddSingleton<IUserInterventionHandler, ThrowingUserInterventionHandler>();
|
||||
service.AddOSIntegrated(o =>
|
||||
{
|
||||
o.UseLocalCache = true;
|
||||
|
@ -90,7 +90,7 @@ public static class ServiceExtensions
|
||||
EncryptedDataLocation = KnownFolders.WabbajackAppLocal.Combine("encrypted"),
|
||||
ModListsDownloadLocation = KnownFolders.EntryPoint.Combine("downloaded_mod_lists"),
|
||||
SavedSettingsLocation = KnownFolders.WabbajackAppLocal.Combine("saved_settings"),
|
||||
LogLocation = KnownFolders.EntryPoint.Combine("logs"),
|
||||
LogLocation = KnownFolders.LauncherAwarePath.Combine("logs"),
|
||||
ImageCacheLocation = KnownFolders.WabbajackAppLocal.Combine("image_cache")
|
||||
});
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using Wabbajack.DTOs.Interventions;
|
||||
|
||||
namespace Wabbajack.Services.OSIntegrated;
|
||||
|
||||
public class ThrowingUserInterventionHandler : IUserInterventionHandler
|
||||
{
|
||||
public void Raise(IUserIntervention intervention)
|
||||
{
|
||||
throw new Exception("Unexpected user intervention, this should throw");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user