LapLogger

Provides functionality for lap logging with various timing details.

Remarks

Every line is logged as a single pre-formatted {Line} argument rather than with one placeholder per column: Microsoft.Extensions.Logging's message template parser has no equivalent of Serilog's {Name,alignment} column padding, so the columns are padded here with ordinary composite-format alignment before the line ever reaches the logger.

Public Methods

RestartTimer

public static void RestartTimer(ILogger logger)

Restart the timer and initialize the logger information.

Parameters:

  • logger (ILogger): The logger instance.

StartLap

public static void StartLap(string lap)

Start a new lap with the specified name.

Parameters:

  • lap (string): The name of the lap.

Lap

public static void Lap(ILogger? logger, string lap, string msg, bool skipTimer = false)

Log the lap information.

Parameters:

  • logger (ILogger?): The logger instance.
  • lap (string): The name of the lap.
  • msg (string): The message to log.
  • skipTimer (bool): Whether to skip the timer or not. (Default: false)