-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run black + remove unused imports. * Log request at different levels depending on request status. Fixes #104. * Add tests for new feature. Related to #104. * Cache request's body to make it accessible after processing. * Apply right log level to multipart log as well. Co-authored-by: sebastien <[email protected]>
- Loading branch information
1 parent
089f843
commit 9bfe9c9
Showing
6 changed files
with
264 additions
and
211 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 |
---|---|---|
|
@@ -10,21 +10,21 @@ | |
|
||
|
||
def read(f): | ||
return open(f, 'r', encoding='utf-8').read() | ||
return open(f, "r", encoding="utf-8").read() | ||
|
||
|
||
def get_version(package): | ||
""" | ||
Return package version as listed in `__version__` in `init.py`. | ||
""" | ||
init_py = open(os.path.join(package, '__init__.py')).read() | ||
init_py = open(os.path.join(package, "__init__.py")).read() | ||
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) | ||
|
||
|
||
version = get_version('request_logging') | ||
version = get_version("request_logging") | ||
|
||
|
||
if sys.argv[-1] == 'publish': | ||
if sys.argv[-1] == "publish": | ||
if os.system("pip freeze | grep twine"): | ||
print("twine not installed.\nUse `pip install twine`.\nExiting.") | ||
sys.exit() | ||
|
@@ -33,24 +33,22 @@ def get_version(package): | |
print("You probably want to also tag the version now:") | ||
print(" git tag -a %s -m 'version %s'" % (version, version)) | ||
print(" git push --tags") | ||
shutil.rmtree('dist') | ||
shutil.rmtree('build') | ||
shutil.rmtree("dist") | ||
shutil.rmtree("build") | ||
sys.exit() | ||
|
||
|
||
setup( | ||
name='django-request-logging', | ||
name="django-request-logging", | ||
version=version, | ||
description='Django middleware that logs http request body.', | ||
long_description=read('README.md'), | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/Rhumbix/django-request-logging.git', | ||
author='Rhumbix', | ||
author_email='[email protected]', | ||
license='MIT', | ||
packages=['request_logging'], | ||
install_requires=[ | ||
'Django', | ||
], | ||
zip_safe=False | ||
description="Django middleware that logs http request body.", | ||
long_description=read("README.md"), | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/Rhumbix/django-request-logging.git", | ||
author="Rhumbix", | ||
author_email="[email protected]", | ||
license="MIT", | ||
packages=["request_logging"], | ||
install_requires=["Django"], | ||
zip_safe=False, | ||
) |
Oops, something went wrong.