Skip to content

Commit

Permalink
Merge pull request #93 from DragonBox/feature/logging/verbose
Browse files Browse the repository at this point in the history
Feature/logging/verbose
  • Loading branch information
Paul Niezborala authored Nov 7, 2019
2 parents 376b77f + 14bfdfa commit e567dfe
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 342 deletions.
13 changes: 11 additions & 2 deletions Assets/Plugins/Editor/Uplift/LogHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ public class LogHandler : IDisposable
private string stack = "";

private StreamWriter OutputStream;
private LogType previouslyFilteredType;

public LogHandler(string fileName = "uplift.log", bool appendToCurrentLogFile = false, bool showStack = false)
public LogHandler(
string fileName = "uplift.log",
bool appendToCurrentLogFile = false,
bool showStack = false,
LogType logType = LogType.Log)
{
previouslyFilteredType = Debug.logger.filterLogType;
Debug.logger.filterLogType = logType;

showStackTrace = showStack;
logFileName = fileName;

Expand All @@ -29,6 +37,7 @@ public LogHandler(string fileName = "uplift.log", bool appendToCurrentLogFile =
public void Dispose()
{
Application.logMessageReceived -= HandleLog;
Debug.logger.filterLogType = previouslyFilteredType;

if (OutputStream != null)
{
Expand All @@ -42,7 +51,7 @@ void HandleLog(string logString, string stackTrace, LogType type)
output = logString;
stack = stackTrace;

OutputStream.WriteLine("[" + type + "]" + output);
OutputStream.WriteLine("[" + type.ToString().ToUpper() + "] " + output);
OutputStream.Flush();

if (showStackTrace)
Expand Down
4 changes: 1 addition & 3 deletions Assets/Plugins/Editor/Uplift/MenuItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ private static void CheckDependencies()
[MenuItem("Tools/Uplift/Install dependencies (as specified in lockfile)", false, 2)]
private static void InstallLockfile()
{
Debug.Log("Installing from Lockfile : ");
Debug.Log("Installing from Lockfile");
UpliftManager.ResetInstances();
UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.ONLY_LOCKFILE);

Debug.Log("-> Resfreshing AssetDatabase");
AssetDatabase.Refresh();
}

Expand All @@ -108,7 +107,6 @@ private static void InstallDependencies()
UpliftManager.ResetInstances();
UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.INCOMPLETE_LOCKFILE);

Debug.Log("-> Resfreshing AssetDatabase");
AssetDatabase.Refresh();
}

Expand Down
Loading

0 comments on commit e567dfe

Please sign in to comment.