You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Add support for parameterized logging method to global logger LambdaLogger in Amazon.Lambda.Core"
8
+
]
9
+
},
10
+
{
11
+
"Name": "Amazon.Lambda.Core",
12
+
"Type": "Patch",
13
+
"ChangelogMessages": [
14
+
"Add support for parameterized logging method to global logger LambdaLogger. Method is marked as preview till new version of Amazon.Lambda.RuntimeSupport is deployed to managed runtime."
// Formatting here is not important, it is used for debugging Amazon.Lambda.Core only.
51
+
// In a real scenario Amazon.Lambda.RuntimeSupport will change the value of _loggingWithLevelAction
52
+
// to an Action inside it's logging system to handle the real formatting.
53
+
varsb=newStringBuilder();
54
+
sb.Append(level).Append(": ").Append(message);
55
+
if(args?.Length>0)
56
+
{
57
+
sb.Append(" Arguments:");
58
+
foreach(vararginargs)
59
+
{
60
+
sb.Append(" \"");
61
+
sb.Append(arg);
62
+
sb.Append("\"");
63
+
}
64
+
}
65
+
Console.WriteLine(sb.ToString());
66
+
}
67
+
68
+
privateconststringParameterizedPreviewMessage=
69
+
"This method has been mark as preview till the Lambda .NET Managed runtime has been updated with the backing implementation of this method. "+
70
+
"It is possible to use this method while in preview if the Lambda function is deployed as an executable and uses the latest version of Amazon.Lambda.RuntimeSupport.";
71
+
72
+
/// <summary>
73
+
/// Logs a message to AWS CloudWatch Logs.
74
+
///
75
+
/// Logging will not be done:
76
+
/// If the role provided to the function does not have sufficient permissions.
77
+
/// </summary>
78
+
/// <param name="level">The log level of the message</param>
79
+
/// <param name="message">Message to log. The message may have format arguments.</param>
80
+
/// <param name="args">Arguments to format the message with.</param>
Copy file name to clipboardExpand all lines: Libraries/test/Amazon.Lambda.RuntimeSupport.Tests/Amazon.Lambda.RuntimeSupport.IntegrationTests/CustomRuntimeTests.cs
+15-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
/*
1
+
/*
2
2
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License").
0 commit comments