aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mac/Main.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-02-24 15:21:11 -0500
committerGitHub <noreply@github.com>2017-02-24 15:21:11 -0500
commitcd6b7f3bdc5bcbc6c68131cc40b71b68ac1b73a6 (patch)
tree48b8f6d94e3f762a486aa1c4fa6937cf23c18dee /MediaBrowser.Server.Mac/Main.cs
parentc07e774ca9c0f234ec6899e17fc70301d1990290 (diff)
parent66a844e6399f1d79be8e10ea098ba6768e0d123b (diff)
Merge pull request #2489 from MediaBrowser/beta
Beta
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)
{