< Summary

Class:GDX.Experimental.Logging.LogEntry
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Experimental/Logging/LogEntry.cs
Covered lines:10
Uncovered lines:8
Coverable lines:18
Total lines:59
Line coverage:55.5% (10 of 18)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ToConsoleOutput()0%110100%
ToUnityOutput()0%110100%
LogLevelToLabel(...)0%39.6310033.33%

File(s)

./Packages/com.dotbunny.gdx/GDX/Experimental/Logging/LogEntry.cs

#LineLine coverage
 1// Copyright (c) 2020-2023 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5using System;
 6using System.Runtime.CompilerServices;
 7
 8namespace GDX.Experimental.Logging
 9{
 10    public struct LogEntry
 11    {
 12        public DateTime Timestamp;
 13        public LogLevel Level;
 14        public uint Identifier;
 15        public uint ParentIdentifier;
 16        public int CategoryIdentifier;
 17        public string Message;
 18        public string MemberName;
 19        public string SourceFilePath;
 20        public int SourceLineNumber;
 21
 22        public string ToConsoleOutput()
 223        {
 224            return
 25                $"[{ManagedLog.GetCategoryLabel(CategoryIdentifier)}::{LogLevelToLabel(Level)}] {Message}\n\t@ {SourceFi
 226        }
 27
 28        public string ToUnityOutput()
 229        {
 230            return  $"{Message}\n\t@ {SourceFilePath}:{SourceLineNumber.ToString()}";
 231        }
 32
 33        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 34        static string LogLevelToLabel(LogLevel level)
 235        {
 236            switch (level)
 37            {
 38                case LogLevel.Trace:
 039                    return "Trace";
 40                case LogLevel.Debug:
 041                    return "Debug";
 42                case LogLevel.Info:
 043                    return "Info";
 44                case LogLevel.Warning:
 245                    return "Warning";
 46                case LogLevel.Error:
 047                    return "Error";
 48                case LogLevel.Exception:
 049                    return "Exception";
 50                case LogLevel.Assertion:
 051                    return "Assertion";
 52                case LogLevel.Fatal:
 053                    return "Fatal";
 54            }
 55
 056            return string.Empty;
 257        }
 58    }
 59}

Coverage by test methods



Methods/Properties

ToConsoleOutput()
ToUnityOutput()
LogLevelToLabel(GDX.Experimental.Logging.LogLevel)