< Summary

Information
Class: ArturRios.Logging.Factories.LogEntryFactory
Assembly: ArturRios.Logging
File(s): D:\Repositories\dotnet-logging\src\Factories\LogEntryFactory.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 1
Fully covered methods: 0
Total methods: 1
Method coverage: 100%
Full method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Create(...)100%11100%

File(s)

D:\Repositories\dotnet-logging\src\Factories\LogEntryFactory.cs

#LineLine coverage
 1using ArturRios.Extensions;
 2
 3namespace ArturRios.Logging.Factories;
 4
 5/// <summary>
 6/// Factory for creating formatted log entry strings.
 7/// </summary>
 8public static class LogEntryFactory
 9{
 10    /// <summary>
 11    /// Creates a formatted log entry string with timestamp, log level, class name, method name, and message.
 12    /// </summary>
 13    /// <param name="level">The log level.</param>
 14    /// <param name="filePath">The source file path.</param>
 15    /// <param name="methodName">The calling method name.</param>
 16    /// <param name="message">The log message.</param>
 17    /// <returns>A formatted log entry string.</returns>
 18    public static string Create(CustomLogLevel level, string filePath, string methodName, string message)
 8819    {
 8820        var logLevel = level.GetDescription()!;
 8821        var className = Path.GetFileNameWithoutExtension(filePath);
 8822        var timestamp = DateTime.UtcNow.ToString("o");
 23
 8824        return $"{logLevel}: {className} | {methodName} | {timestamp} | {message}{Environment.NewLine}";
 8825    }
 26}