internal static void WriteBuildLog(BuildLog log, string directory)
 {
     Directory.CreateDirectory(directory);
     PackageManager.PackageInfo info = PackageManager.PackageInfo.FindForAssembly(typeof(BuildScriptBase).Assembly);
     log.AddMetaData(info.name, info.version);
     File.WriteAllText(Path.Combine(directory, "AddressablesBuildTEP.json"), log.FormatForTraceEventProfiler());
 }
        internal static void WriteBuildLog(BuildLog log, string directory)
        {
            Directory.CreateDirectory(directory);
#if UNITY_2019_2_OR_NEWER // PackageManager package inspection APIs didn't exist until 2019.2
            PackageManager.PackageInfo info = PackageManager.PackageInfo.FindForAssembly(typeof(BuildScriptBase).Assembly);
            log.AddMetaData(info.name, info.version);
#endif
            File.WriteAllText(Path.Combine(directory, "AddressablesBuildTEP.json"), log.FormatForTraceEventProfiler());
        }
Exemple #3
0
        public void WhenConvertingToTraceEventFormat_MetaDataIsAdded()
        {
            BuildLog log = new BuildLog();

            log.AddMetaData("SOMEKEY", "SOMEVALUE");
            string text = log.FormatForTraceEventProfiler();

            StringAssert.Contains("SOMEKEY", text);
            StringAssert.Contains("SOMEVALUE", text);
        }
Exemple #4
0
        public void WhenConvertingToTraceEventFormat_BackslashesAreEscaped()
        {
            BuildLog log = new BuildLog();

            using (log.ScopedStep(LogLevel.Info, "TestStep\\AfterSlash"))
                log.AddEntry(LogLevel.Info, "TestEntry\\AfterSlash");
            string text = log.FormatForTraceEventProfiler();

            StringAssert.Contains("TestStep\\\\AfterSlash", text);
            StringAssert.Contains("TestEntry\\\\AfterSlash", text);
        }
        public void Dispose()
        {
            Application.logMessageReceived -= OnLogMessageReceived;

            m_Output.Dispose();

            using (var traceStream = new StreamWriter(m_Filepath + ".trace"))
            {
                traceStream.WriteLine(m_Builtin.FormatForTraceEventProfiler());
            }
        }