-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(configurable-logger): add support for the configurable logger (#58)
This commit introduces the configurable logger feature. With this enhancement, the core library now boasts a flexible logging system tailored specifically for logging HTTP request and response information. By addressing the lack of a standardized logging mechanism, developers can now effectively debug and monitor network interactions with ease. The implementation includes a modular logging framework supporting customizable logging formats, default logger, and verbosity levels, empowering users to tailor logging behavior to their specific requirements. Additionally, seamless integration with existing logging libraries. This enhancement marks a significant step towards improving the usability and reliability of the core library, enhancing the development experience for our community.
- Loading branch information
1 parent
45ce9e1
commit 1966ce7
Showing
23 changed files
with
1,029 additions
and
205 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
'factories', | ||
'types', | ||
'logger', | ||
'exceptions' | ||
'exceptions', | ||
'constants' | ||
] |
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,3 @@ | ||
__all__ = [ | ||
'logger_constants' | ||
] |
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,44 @@ | ||
|
||
class LoggerConstants: | ||
METHOD = "method" | ||
"""Key representing the method of the HTTP request.""" | ||
|
||
URL = "url" | ||
"""Key representing the URL of the HTTP request.""" | ||
|
||
QUERY_PARAMETER = "query_parameter" | ||
"""Key representing the query parameters of the HTTP request.""" | ||
|
||
HEADERS = "headers" | ||
"""Key representing the headers of the HTTP request or response.""" | ||
|
||
BODY = "body" | ||
"""Key representing the body of the HTTP request or response.""" | ||
|
||
STATUS_CODE = "status_code" | ||
"""Key representing the status code of the HTTP response.""" | ||
|
||
CONTENT_LENGTH = "content_length" | ||
"""Key representing the content length of the HTTP response.""" | ||
|
||
CONTENT_TYPE = "content_type" | ||
"""Key representing the content type of the HTTP response.""" | ||
|
||
CONTENT_LENGTH_HEADER = "content-length" | ||
"""Key representing the content length header.""" | ||
|
||
CONTENT_TYPE_HEADER = "content-type" | ||
"""Key representing the content type header.""" | ||
|
||
NON_SENSITIVE_HEADERS = tuple(map(lambda x: x.lower(), [ | ||
"Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", | ||
"Access-Control-Allow-Origin", "Cache-Control", "Connection", | ||
"Content-Encoding", "Content-Language", "Content-Length", "Content-Location", | ||
"Content-MD5", "Content-Range", "Content-Type", "Date", "ETag", "Expect", | ||
"Expires", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match", | ||
"If-Range", "If-Unmodified-Since", "Keep-Alive", "Last-Modified", "Location", | ||
"Max-Forwards", "Pragma", "Range", "Referer", "Retry-After", "Server", | ||
"Trailer", "Transfer-Encoding", "Upgrade", "User-Agent", "Vary", "Via", | ||
"Warning", "X-Forwarded-For", "X-Requested-With", "X-Powered-By" | ||
])) | ||
"""List of sensitive headers that need to be filtered.""" |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
__all__ = [ | ||
'endpoint_logger' | ||
] | ||
'default_logger', | ||
'sdk_logger', | ||
'configuration' | ||
] |
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,3 @@ | ||
__all__ = [ | ||
"api_logging_configuration", | ||
] |
Oops, something went wrong.