-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
502 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "Fantome.Libraries.League"] | ||
path = Fantome.Libraries.League | ||
url = https://github.com/LoL-Fantome/Fantome.Libraries.League |
Submodule Fantome.Libraries.League
added at
1e3269
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" /> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> | ||
</startup> | ||
</configuration> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using log4net.Core; | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
|
||
namespace Obsidian.Utils | ||
{ | ||
public static class ConfigUtilities | ||
{ | ||
public static readonly Dictionary<string, object> DefaultConfig = new Dictionary<string, object>() | ||
{ | ||
{ "LoggingPattern", "[%utcdate{ABSOLUTE}] | [%-5level] | [%-20logger: (%-4line)] | %message%newline" }, | ||
{ "LogLevel", Level.Info }, | ||
{ "WadSaveMajorVersion", 2 }, | ||
{ "WadSaveMinorVersion", 0 }, | ||
{ "GenerateWadDictionary", true }, | ||
{ "ParallelExtraction", true } | ||
}; | ||
|
||
public static Dictionary<string, object> ReadConfig() | ||
{ | ||
return JsonConvert.DeserializeObject<Dictionary<string, object>>(File.ReadAllText("config.json")); | ||
} | ||
|
||
public static void WriteDefaultConfig() | ||
{ | ||
File.WriteAllText("config.json", JsonConvert.SerializeObject(DefaultConfig, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using log4net; | ||
using log4net.Appender; | ||
using log4net.Config; | ||
using log4net.Core; | ||
using log4net.Layout; | ||
using System; | ||
using System.Windows; | ||
|
||
namespace Obsidian.Utils | ||
{ | ||
public static class Logging | ||
{ | ||
public static void InitializeLogger(string loggingPattern, Level logLevel) | ||
{ | ||
FileAppender appender = new FileAppender | ||
{ | ||
Layout = new PatternLayout(loggingPattern), | ||
File = "ObsidianLog.txt", | ||
AppendToFile = true, | ||
Threshold = logLevel | ||
}; | ||
appender.ActivateOptions(); | ||
BasicConfigurator.Configure(appender); | ||
} | ||
|
||
public static void LogException(ILog logger, string message, Exception exception) | ||
{ | ||
MessageBox.Show(string.Format("{0}\n{1}\n{2}", message, exception.Message, exception.StackTrace), "", MessageBoxButton.OK, MessageBoxImage.Error); | ||
logger.Error(message, exception); | ||
} | ||
|
||
public static void LogFatal(ILog logger, string message, Exception exception) | ||
{ | ||
MessageBox.Show(string.Format("{0}\n{1}\n{2}", message, exception.Message, exception.StackTrace), "", MessageBoxButton.OK, MessageBoxImage.Error); | ||
logger.Fatal(message, exception); | ||
} | ||
} | ||
} |
Oops, something went wrong.