-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update logging logic to make it more flexible, deprecate existing met…
…hods
- Loading branch information
1 parent
2194d2b
commit a83796f
Showing
13 changed files
with
696 additions
and
65 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
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,46 @@ | ||
// <copyright file="LogConfiguration.cs" company="On Test Automation"> | ||
// Copyright 2019 the original author or authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
namespace RestAssured.Logging | ||
{ | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// Defines the configuration to be used when logging request or response details. | ||
/// </summary> | ||
public class LogConfiguration | ||
{ | ||
/// <summary> | ||
/// The request logging level for this request. | ||
/// </summary> | ||
public RequestLogLevel RequestLogLevel { get; set; } = RequestLogLevel.None; | ||
|
||
/// <summary> | ||
/// The response logging level for this request. | ||
/// </summary> | ||
public ResponseLogLevel ResponseLogLevel { get; set; } = ResponseLogLevel.None; | ||
|
||
/// <summary> | ||
/// A list of sensitive request header and cookie names that should be redacted when logging request details. | ||
/// </summary> | ||
public List<string> SensitiveRequestHeadersAndCookies { get; set; } = new List<string>(); | ||
|
||
/// <summary> | ||
/// A list of sensitive response header and cookie names that should be redacted when logging response details. | ||
/// </summary> | ||
public List<string> SensitiveResponseHeadersAndCookies { get; set; } = new List<string>(); | ||
} | ||
} |
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 @@ | ||
// <copyright file="RequestLogLevel.cs" company="On Test Automation"> | ||
// Copyright 2019 the original author or authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
namespace RestAssured.Logging | ||
{ | ||
/// <summary> | ||
/// Contains the different logging levels for request logging. | ||
/// </summary> | ||
public enum RequestLogLevel | ||
{ | ||
/// <summary> | ||
/// Nothing will be logged to the console. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// The HTTP method and the endpoint will be logged to the console. | ||
/// </summary> | ||
Endpoint = 1, | ||
|
||
/// <summary> | ||
/// Request headers will be logged to the console. | ||
/// </summary> | ||
Headers = 2, | ||
|
||
/// <summary> | ||
/// Request body will be logged to the console. | ||
/// </summary> | ||
Body = 3, | ||
|
||
/// <summary> | ||
/// All request details will be logged to the console. | ||
/// </summary> | ||
All = 4, | ||
} | ||
} |
Oops, something went wrong.