• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemoBytom / DemoEngine / 24940020806

25 Apr 2026 08:30PM UTC coverage: 28.251% (-1.5%) from 29.75%
24940020806

push

coveralls.net

DemoBytom
Remove old `StaThreadService` and related codebase

Superseeded by `WindowsMessagePump`

1208 of 4276 relevant lines covered (28.25%)

0.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Demo.Engine.Core/Services/LoggingExtensions.cs
1
// Copyright © Michał Dembski and contributors.
2
// Distributed under MIT license. See LICENSE file in the root for more information.
3

4
using Demo.Engine.Core.ValueObjects;
5
using Microsoft.Extensions.Logging;
6

7
namespace Demo.Engine.Core.Services;
8

9
// cannot be file scoped!
10
internal static partial class LoggingExtensions
11
{
12
    private const string SERVICE_IS_STARTING = "{ServiceName} starting! v{Version}";
13
    private const string SERVICE_IS_WORKING = "{ServiceName} working! v{Version}";
14
    private const string SERVICE_IS_STOPPING = "{ServiceName} stopping!";
15
    private const string SERVICE_FAILED_WITH_ERROR = "{ServiceName} failed with error! {ErrorMessage}";
16

17
    private const string AVERAGE_FPS = "{SurfaceId}: Avg. frame (ms): {Millisecond}, fps: {FPS}";
18
    private const string AVERAGE_UPS = "Avg. update (ms): {Millisecond}, ups: {UPS}";
19

20
    private const string MAIN_LOOP_RENDERING_SURFACE_NOT_FOUND = "Rendering surface {SurfaceId} not found!";
21

22
    [LoggerMessage(
23
        Level = LogLevel.Debug,
24
        Message = SERVICE_IS_STARTING)]
25
    internal static partial void LogServiceIsStarting(
26
        this ILogger logger,
27
        string serviceName,
28
        string version);
29

30
    [LoggerMessage(
31
        Level = LogLevel.Debug,
32
        Message = SERVICE_IS_WORKING)]
33
    internal static partial void LogServiceIsWorking(
34
        this ILogger logger,
35
        string serviceName,
36
        string version);
37

38
    [LoggerMessage(
39
        Level = LogLevel.Debug,
40
        Message = SERVICE_IS_STOPPING)]
41
    internal static partial void LogServiceStopping(
42
        this ILogger logger,
43
        string serviceName);
44

45
    [LoggerMessage(
46
        Level = LogLevel.Critical,
47
        Message = SERVICE_FAILED_WITH_ERROR)]
48
    private static partial void LogServiceFailedWithError(
49
        this ILogger logger,
50
        Exception exception,
51
        string serviceName,
52
        string errorMessage);
53

54
    internal static void LogServiceFailedWithError(
55
        this ILogger logger,
56
        Exception exception,
57
        string serviceName)
58
        => logger.LogServiceFailedWithError(
×
59
            exception,
×
60
            serviceName,
×
61
            exception.Message);
×
62

63
    [LoggerMessage(
64
        Level = LogLevel.Trace,
65
        Message = AVERAGE_FPS)]
66
    internal static partial void LogAverageSurfaceFps(
67
        this ILogger logger,
68
        RenderingSurfaceId surfaceId,
69
        float millisecond,
70
        ulong fps);
71

72
    [LoggerMessage(
73
        Level = LogLevel.Trace,
74
        Message = AVERAGE_UPS)]
75
    internal static partial void LogAverageUps(
76
        this ILogger logger,
77
        float millisecond,
78
        ulong ups);
79

80
    internal static void LogMainLoopFailedWithError(
81
        this ILogger<MainLoopService> logger,
82
        Exception exception)
83
        => logger.LogServiceFailedWithError(
×
84
            exception,
×
85
            nameof(MainLoopService),
×
86
            exception.Message);
×
87

88
    [LoggerMessage(
89
        Level = LogLevel.Critical,
90
        Message = MAIN_LOOP_RENDERING_SURFACE_NOT_FOUND)]
91
    internal static partial void LogRenderingSurfaceNotFound(
92
        this ILogger<MainLoopService> logger,
93
        RenderingSurfaceId surfaceId);
94
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc