< Summary

Class:DCL.LogReport.LogReportPlugin
Assembly:LogReportPlugin
File(s):/tmp/workspace/explorer-desktop/unity-renderer-desktop/Assets/Scripts/MainScripts/DCL/Controllers/LogReport/LogReportPlugin.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:34
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LogReportPlugin()0%2100%
UnhandledExceptionCallback(...)0%6200%
LogCallback(...)0%2100%
Dispose()0%2100%

File(s)

/tmp/workspace/explorer-desktop/unity-renderer-desktop/Assets/Scripts/MainScripts/DCL/Controllers/LogReport/LogReportPlugin.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4namespace DCL.LogReport
 5{
 6    public class LogReportPlugin : IPlugin
 7    {
 08        public LogReportPlugin()
 9        {
 010            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionCallback;
 011            Application.logMessageReceived += LogCallback;
 012        }
 13
 14        private void UnhandledExceptionCallback(object sender, UnhandledExceptionEventArgs e)
 15        {
 016            if (e.ExceptionObject is Exception exception)
 017                LogReportKernelInterface.ReportLog("error", exception.Message);
 018        }
 19
 20        private void LogCallback(string condition, string stackTrace, LogType type)
 21        {
 022            System.Diagnostics.StackTrace sTrace = new System.Diagnostics.StackTrace();
 023            string message = $"{condition}\n{sTrace.ToString()}";
 24
 025            LogReportKernelInterface.ReportLog(type, message);
 026        }
 27
 28        public void Dispose()
 29        {
 030            AppDomain.CurrentDomain.UnhandledException -= UnhandledExceptionCallback;
 031            Application.logMessageReceived -= LogCallback;
 032        }
 33    }
 34}