Skip to content

Commit

Permalink
Fix log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Nov 24, 2024
1 parent 015fc75 commit be77a7d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Runtime/AgentDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AgentDispatcher : IAgentDispatcher
private readonly RandomFactory _randomFactory;

/// <summary>
/// Constructor
/// Constructor.
/// </summary>
/// <param name="settings"></param>
/// <param name="logger"></param>
Expand All @@ -57,7 +57,7 @@ public void Dispose()
{
foreach (var inspector in AgentInspector.Instances)
{
_logger.Log($"Destroy running agent: {inspector.gameObject.name}");
_logger.Log($"Destroy running Agent: {inspector.gameObject.name}");
Object.Destroy(inspector.gameObject);
}

Expand Down Expand Up @@ -87,12 +87,12 @@ public bool DispatchByScene(Scene scene, bool fallback = true)
{
if (_settings.fallbackAgent && fallback)
{
_logger.Log($"Use fallback agent. scene: {scene.path}");
_logger.Log($"Use fallback Agent. Scene: {scene.name}");
agent = _settings.fallbackAgent;
}
else
{
_logger.Log(LogType.Warning, $"Agent not found by scene: {scene.name}");
_logger.Log(LogType.Warning, $"Agent not specified for Scene: {scene.name}");
}
}

Expand Down Expand Up @@ -127,7 +127,7 @@ private void DispatchAgent(AbstractAgent agent, bool dontDestroyOnLoad = false)
}

var token = inspector.gameObject.GetCancellationTokenOnDestroy();
_logger.Log($"Dispatch agent: {agentName}");
_logger.Log($"Dispatch Agent: {agentName}");
agent.Run(token).Forget(); // Agent also dies when GameObject is destroyed
}
}
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Autopilot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private static void OnExitPlayModeToTerminateEditor(PlayModeStateChange playMode
// Exit Unity when returning from play mode to edit mode.
// Because it may freeze when exiting without going through edit mode.
var exitCode = (int)AutopilotState.Instance.exitCode;
Debug.Log($"Exit Unity-editor by autopilot, exit code: {exitCode}");
Debug.Log($"Exit Unity-editor by Autopilot, exit code: {exitCode}");
EditorApplication.Exit(exitCode);
}

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal static async UniTaskVoid LaunchAutopilot()

var logger = Debug.unityLogger; // Note: Logger is not initialized yet.
const ExitCode ExitCode = ExitCode.AutopilotLaunchingFailed;
const string Caller = "Autopilot launcher";
const string Caller = "Launcher";
Debug.Log("Cancel launching Autopilot");
TeardownLaunchAutopilotAsync(state, logger, ExitCode, Caller).Forget();
return;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Runtime/AgentDispatcherTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async Task DispatchByScene_NoSceneAgentMapsAndFallbackAgent_AgentIsNotDis

await SceneManagerHelper.LoadSceneAsync(TestScenePath);

LogAssert.Expect(LogType.Warning, "Agent not found by scene: Buttons");
LogAssert.Expect(LogType.Warning, "Agent not specified for Scene: Buttons");
Assert.That(SpyAliveCountAgent.AliveInstances, Is.EqualTo(0));
}

Expand Down

0 comments on commit be77a7d

Please sign in to comment.