-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from jgdevlabs/dev
Performance improvements and meta data changes
- Loading branch information
Showing
15 changed files
with
177 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using Griesoft.AspNetCore.ReCaptcha.Localization; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Griesoft.AspNetCore.ReCaptcha.Extensions | ||
{ | ||
internal static class LoggerExtensions | ||
{ | ||
private static readonly Action<ILogger, Exception?> _validationRequestFailed = LoggerMessage.Define( | ||
LogLevel.Warning, | ||
new EventId(1, nameof(ValidationRequestFailed)), | ||
Resources.RequestFailedErrorMessage); | ||
|
||
private static readonly Action<ILogger, Exception?> _validationRequestUnexpectedException = LoggerMessage.Define( | ||
LogLevel.Critical, | ||
new EventId(2, nameof(ValidationRequestUnexpectedException)), | ||
Resources.ValidationUnexpectedErrorMessage); | ||
|
||
private static readonly Action<ILogger, Exception?> _recaptchaResponseTokenMissing = LoggerMessage.Define( | ||
LogLevel.Warning, | ||
new EventId(3, nameof(RecaptchaResponseTokenMissing)), | ||
Resources.RecaptchaResponseTokenMissing); | ||
|
||
private static readonly Action<ILogger, Exception?> _invalidResponseToken = LoggerMessage.Define( | ||
LogLevel.Information, | ||
new EventId(4, nameof(InvalidResponseToken)), | ||
Resources.InvalidResponseTokenMessage); | ||
|
||
public static void ValidationRequestFailed(this ILogger logger) | ||
{ | ||
_validationRequestFailed(logger, null); | ||
} | ||
|
||
public static void ValidationRequestUnexpectedException(this ILogger logger, Exception exception) | ||
{ | ||
_validationRequestUnexpectedException(logger, exception); | ||
} | ||
|
||
public static void RecaptchaResponseTokenMissing(this ILogger logger) | ||
{ | ||
_recaptchaResponseTokenMissing(logger, null); | ||
} | ||
|
||
public static void InvalidResponseToken(this ILogger logger) | ||
{ | ||
_invalidResponseToken(logger, null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.