-
Notifications
You must be signed in to change notification settings - Fork 489
Update global logger to support logging with level and arguments. #2005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
{ | ||
"Projects": [ | ||
{ | ||
"Name": "Amazon.Lambda.RuntimeSupport", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to have 2 entries for RuntimeSupport? Seems like both can be combined into 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. The second one is supposed to be Amazon.Lambda.Core
which I marked as preview
since the API is in preview status. It will get a minor version bump once the API is out of preview.
@@ -9,8 +12,11 @@ namespace Amazon.Lambda.Core | |||
/// </summary> | |||
public static class LambdaLogger | |||
{ | |||
// Logging action, logs to Console by default | |||
// The name of this field must not change or be readonly because Amazon.Runtime.Support will use reflection to replace the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong name "Amazon.Runtime.Support"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
#if NET6_0_OR_GREATER | ||
|
||
// The name of this field must not change or be readonly because Amazon.Runtime.Support will use reflection to replace the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong name "Amazon.Runtime.Support"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
private static void LogWithLevelToConsole(string level, string message, params object[] args) | ||
{ | ||
// Formatting here is not important, it is used for debugging Amazon.Lambda.Core only. | ||
// In a real scenario Amazon.Runtime.Support will change the value of _loggingWithLevelAction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong name "Amazon.Runtime.Support"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
private const string ParameterizedPreviewMessage = | ||
"This method has been mark as preview till the Lambda .NET Managed runtime has been updated with the backing implementation of this method. " + | ||
"It is possible to use this method whilein preview if the Lambda function is deployed as an executable and uses the latest version of Amazon.Lambda.RuntimeSupport."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo in "whilein"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Issue #, if available:
#1747 (comment)
Description of changes:
Add to the global logger
LambdaLogger
in Amazon.Lambda.Core a new parameterized logging method that takes in log level. The method is marked as preview till the new version of Amazon.Lambda.RuntimeSupport is deployed to the managed runtime.Once the PR is deployed to the managed runtime we can update
Amazon.Lambda.Logging.AspNetCore
to use this new method so the log levels will be honored.Testing
Ran tests and added an integ test cases for the new logging scenario.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.