Skip to content

Commit

Permalink
feat(core): prefix logs from unitygit with "[unitygit]"
Browse files Browse the repository at this point in the history
  • Loading branch information
jonisavo committed Aug 20, 2023
1 parent b7a87b8 commit b3a1580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UnityGitLogServiceTests
public void LogMessage_AddsOutputLineToList()
{
var logService = new UnityGitLogService();
var expectedLine = new OutputLine("Test message", false);
var expectedLine = new OutputLine("[unitygit] Test message", false);

logService.LogMessage("Test message");
var outputLines = logService.GetOutputLines();
Expand All @@ -25,7 +25,7 @@ public void LogMessage_AddsOutputLineToList()
public void LogError_AddsOutputLineToList()
{
var logService = new UnityGitLogService();
var expectedLine = new OutputLine("Test error", true);
var expectedLine = new OutputLine("[unitygit] Test error", true);

logService.LogError("Test error");
var outputLines = logService.GetOutputLines();
Expand Down Expand Up @@ -54,11 +54,11 @@ public void LogException_LogsExceptionDetails()
var outputLines = logService.GetOutputLines();

Assert.AreEqual(3, outputLines.Count);
Assert.AreEqual("TestException occurred.", outputLines[0].Text);
Assert.AreEqual("[unitygit] TestException occurred.", outputLines[0].Text);
Assert.AreEqual(true, outputLines[0].IsError);
Assert.AreEqual("Test exception", outputLines[1].Text);
Assert.AreEqual("[unitygit] Test exception", outputLines[1].Text);
Assert.AreEqual(true, outputLines[1].IsError);
Assert.AreEqual(outputLines[2].Text, "Stack trace");
Assert.AreEqual("[unitygit] Stack trace", outputLines[2].Text);
Assert.AreEqual(true, outputLines[2].IsError);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public sealed class UnityGitLogService : ILogService

public void LogMessage(string line)
{
var outputLine = new OutputLine(line, false);
var outputLine = new OutputLine("[unitygit] " + line, false);
LogOutputLine(outputLine);
}

public void LogError(string line)
{
var outputLine = new OutputLine(line, true);
var outputLine = new OutputLine("[unitygit] " + line, true);
LogOutputLine(outputLine);
}

Expand Down

0 comments on commit b3a1580

Please sign in to comment.