- Home /
CS0246 - DeploymentTargetLogger could not be found
using System; using System.Collections.Generic; using UnityEditor.DeploymentTargets; using UnityEditor.TestTools.TestRunner.CommandLineTest; using UnityEngine;
namespace UnityEditor.TestRunner.TestLaunchers { [Serializable] internal class RemotePlayerLogController : ScriptableSingleton { private List m_LogWriters;
private Dictionary<string, DeploymentTargetLogger> m_Loggers;
private string m_DeviceLogsDirectory;
public void SetBuildTarget(BuildTarget buildTarget)
{
m_Loggers = GetDeploymentTargetLoggers(buildTarget);
}
public void SetLogsDirectory(string dir)
{
m_DeviceLogsDirectory = dir;
}
public void StartLogWriters()
{
if (m_DeviceLogsDirectory == null || m_Loggers == null)
return;
m_LogWriters = new List<LogWriter>();
foreach (var logger in m_Loggers)
{
m_LogWriters.Add(new LogWriter(m_DeviceLogsDirectory, logger.Key, logger.Value));
logger.Value.Start();
}
}
public void StopLogWriters()
{
if (m_LogWriters == null)
return;
foreach (var logWriter in m_LogWriters)
{
logWriter.Stop();
}
}
private Dictionary<string, DeploymentTargetLogger> GetDeploymentTargetLoggers(BuildTarget buildTarget)
{
DeploymentTargetManager deploymentTargetManager;
try
{
deploymentTargetManager = DeploymentTargetManager.CreateInstance(EditorUserBuildSettings.activeBuildTargetGroup, buildTarget);
}
catch (NotSupportedException ex)
{
Debug.Log(ex.Message);
Debug.Log("Deployment target logger not initialised");
return null;
}
var targets = deploymentTargetManager.GetKnownTargets();
var loggers = new Dictionary<string, DeploymentTargetLogger>();
foreach (var target in targets)
{
if (target.status != DeploymentTargetStatus.Ready) continue;
var logger = deploymentTargetManager.GetTargetLogger(target.id);
logger.Clear();
loggers.Add(target.id, logger);
}
return loggers;
}
}
}
capture.png
(13.9 kB)
Comment
Your answer

Follow this Question
Related Questions
Photon and the tutorial on cjrgaming.com 1 Answer
[Win app] CS0246 & CS0234 :BindingFlags and Cryptography 2 Answers
Missing assembly references when importing/upgrading DOTS stack 1 Answer
What does "The type or namespace name x could not be found" mean? 5 Answers
itween imports into compile errors 1 Answer