aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mac/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Mac/Main.cs')
-rw-r--r--MediaBrowser.Server.Mac/Main.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs
index 8c5ca6c1f..debd5f539 100644
--- a/MediaBrowser.Server.Mac/Main.cs
+++ b/MediaBrowser.Server.Mac/Main.cs
@@ -22,6 +22,7 @@ using MonoMac.ObjCRuntime;
using Emby.Server.Core;
using Emby.Server.Implementations;
using Emby.Common.Implementations.Logging;
+using Emby.Server.Implementations.Logging;
using Emby.Common.Implementations.EnvironmentInfo;
using Emby.Server.Mac.Native;
using Emby.Server.Implementations.IO;
@@ -29,6 +30,8 @@ using Emby.Common.Implementations.Networking;
using Emby.Common.Implementations.Security;
using Mono.Unix.Native;
using MediaBrowser.Model.System;
+using MediaBrowser.Model.IO;
+using Emby.Server.Core.Logging;
namespace MediaBrowser.Server.Mac
{
@@ -37,6 +40,7 @@ namespace MediaBrowser.Server.Mac
internal static MacAppHost AppHost;
private static ILogger _logger;
+ private static IFileSystem _fileSystem;
static void Main (string[] args)
{
@@ -83,7 +87,9 @@ namespace MediaBrowser.Server.Mac
// Within the mac bundle, go uo two levels then down into Resources folder
var resourcesPath = Path.Combine(Path.GetDirectoryName(appFolderPath), "Resources");
- return new ServerApplicationPaths(programDataPath, appFolderPath, resourcesPath);
+ Action<string> createDirectoryFn = (string obj) => Directory.CreateDirectory(obj);
+
+ return new ServerApplicationPaths(programDataPath, appFolderPath, resourcesPath, createDirectoryFn);
}
/// <summary>
@@ -102,6 +108,8 @@ namespace MediaBrowser.Server.Mac
var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), false, false, appPaths.TempDirectory);
fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));
+ _fileSystem = fileSystem;
+
var environmentInfo = GetEnvironmentInfo();
var imageEncoder = ImageEncoderHelper.GetImageEncoder(_logger,
@@ -294,7 +302,9 @@ namespace MediaBrowser.Server.Mac
{
var exception = (Exception)e.ExceptionObject;
- new UnhandledExceptionWriter(AppHost.ServerConfigurationManager.ApplicationPaths, _logger, AppHost.LogManager).Log(exception);
+ var consoleLogger = new ConsoleLogger();
+
+ new UnhandledExceptionWriter(AppHost.ServerConfigurationManager.ApplicationPaths, _logger, AppHost.LogManager, _fileSystem, consoleLogger).Log(exception);
if (!Debugger.IsAttached)
{