Skip to content

Commit

Permalink
Remove RequiresPreviewFeatures attribute from logging APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
normj committed Nov 6, 2024
1 parent d7d8ebe commit d41ea18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
11 changes: 11 additions & 0 deletions .autover/changes/408f1584-3b66-45eb-bdf3-d154527e4c8c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Projects": [
{
"Name": "Amazon.Lambda.Core",
"Type": "Minor",
"ChangelogMessages": [
"Removed RequiresPreviewFeatures attribute from parameterized logging APIs"
]
}
]
}
22 changes: 0 additions & 22 deletions Libraries/src/Amazon.Lambda.Core/ILambdaLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ public interface ILambdaLogger
void LogCritical(string message) => Log(LogLevel.Critical.ToString(), message);


private const string ParameterizedPreviewMessage =
"Parameterized logging is in preview till a new version of .NET Lambda runtime client that supports parameterized logging " +
"has been deployed to the .NET Lambda managed runtime. Till deployment has been made the feature can be used by deploying as an " +
"executable including the latest version of Amazon.Lambda.RuntimeSupport and setting the \"EnablePreviewFeatures\" in the Lambda " +
"project file to \"true\"";

/// <summary>
/// Log message categorized by the given log level
/// <para>
Expand All @@ -163,7 +157,6 @@ public interface ILambdaLogger
/// <param name="level">Log level of the message.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void Log(string level, string message, params object[] args) => Log(level, message, args);

/// <summary>
Expand All @@ -177,7 +170,6 @@ public interface ILambdaLogger
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void Log(string level, Exception exception, string message, params object[] args)
{
Log(level, message, args);
Expand All @@ -194,7 +186,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="level">Log level of the message.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void Log(LogLevel level, string message, params object[] args) => Log(level.ToString(), message, args);

/// <summary>
Expand All @@ -208,7 +199,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void Log(LogLevel level, Exception exception, string message, params object[] args) => Log(level.ToString(), exception, message, args);

/// <summary>
Expand All @@ -220,7 +210,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogTrace(string message, params object[] args) => Log(LogLevel.Trace.ToString(), message, args);

/// <summary>
Expand All @@ -233,7 +222,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogTrace(Exception exception, string message, params object[] args) => Log(LogLevel.Trace.ToString(), exception, message, args);

/// <summary>
Expand All @@ -245,7 +233,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogDebug(string message, params object[] args) => Log(LogLevel.Debug.ToString(), message, args);

/// <summary>
Expand All @@ -258,7 +245,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogDebug(Exception exception, string message, params object[] args) => Log(LogLevel.Debug.ToString(), exception, message, args);

/// <summary>
Expand All @@ -270,7 +256,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogInformation(string message, params object[] args) => Log(LogLevel.Information.ToString(), message, args);

/// <summary>
Expand All @@ -283,7 +268,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogInformation(Exception exception, string message, params object[] args) => Log(LogLevel.Information.ToString(), exception, message, args);

/// <summary>
Expand All @@ -295,7 +279,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogWarning(string message, params object[] args) => Log(LogLevel.Warning.ToString(), message, args);

/// <summary>
Expand All @@ -308,7 +291,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogWarning(Exception exception, string message, params object[] args) => Log(LogLevel.Warning.ToString(), exception, message, args);

/// <summary>
Expand All @@ -320,7 +302,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogError(string message, params object[] args) => Log(LogLevel.Error.ToString(), message, args);

/// <summary>
Expand All @@ -333,7 +314,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogError(Exception exception, string message, params object[] args) => Log(LogLevel.Error.ToString(), exception, message, args);

/// <summary>
Expand All @@ -345,7 +325,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// </summary>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogCritical(string message, params object[] args) => Log(LogLevel.Critical.ToString(), message, args);

/// <summary>
Expand All @@ -358,7 +337,6 @@ void Log(string level, Exception exception, string message, params object[] args
/// <param name="exception">Exception to include with the logging.</param>
/// <param name="message">Message to log.</param>
/// <param name="args">Values to be replaced in log messages that are parameterized.</param>
[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
void LogCritical(Exception exception, string message, params object[] args) => Log(LogLevel.Critical.ToString(), exception, message, args);

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,11 @@ public void Log(string level, string message)
_consoleLoggerRedirector.FormattedWriteLine(level, message);
}

private const string ParameterizedPreviewMessage =
"Parameterized logging is in preview till a new version of .NET Lambda runtime client that supports parameterized logging " +
"has been deployed to the .NET Lambda managed runtime. Till deployment has been made the feature can be used by deploying as an " +
"executable including the latest version of Amazon.Lambda.RuntimeSupport and setting the \"LangVersion\" in the Lambda " +
"project file to \"preview\"";

[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
public void Log(string level, string message, params object[] args)
{
_consoleLoggerRedirector.FormattedWriteLine(level, message, args);
}

[RequiresPreviewFeatures(ParameterizedPreviewMessage)]
public void Log(string level, Exception exception, string message, params object[] args)
{
_consoleLoggerRedirector.FormattedWriteLine(level, exception, message, args);
Expand Down

0 comments on commit d41ea18

Please sign in to comment.