public static void LogDebug <TState>(
     this ILogger logger, RelationalLoggingEventId eventId, TState state, Func <TState, string> formatter)
 {
     if (logger.IsEnabled(LogLevel.Debug))
     {
         logger.Log(LogLevel.Debug, (int)eventId, state, null, (s, __) => formatter((TState)s));
     }
 }
 private static void LogInformation <TState>(
     this ILogger logger, RelationalLoggingEventId eventId, Func <TState> state, Func <TState, string> formatter)
 {
     if (logger.IsEnabled(LogLevel.Information))
     {
         logger.Log(LogLevel.Information, (int)eventId, state(), null, (s, _) => formatter((TState)s));
     }
 }
 public static void LogDebug(
     this ILogger logger, RelationalLoggingEventId eventId, Func <string> formatter)
 {
     if (logger.IsEnabled(LogLevel.Debug))
     {
         logger.Log <object>(LogLevel.Debug, (int)eventId, null, null, (_, __) => formatter());
     }
 }
 public static void LogVerbose(
     this ILogger logger, RelationalLoggingEventId eventId, Func <string> formatter)
 {
     if (logger.IsEnabled(LogLevel.Verbose))
     {
         logger.Log(LogLevel.Verbose, (int)eventId, null, null, (_, __) => formatter());
     }
 }