Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Include plugin info in --debug output #1165

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

BoboTiG
Copy link
Contributor

@BoboTiG BoboTiG commented Sep 23, 2021

Closes #455.

Example:

$ http --debug pie.dev/get
HTTPie 2.6.0.dev0
Requests 2.26.0
Pygments 2.10.0
Python 3.9.7+ (heads/3.9:09390c837a, Sep 22 2021, 11:36:19) 
[GCC 10.3.0]
/home/tiger-222/projects/httpie/venv39/bin/python
Linux 5.10.0-8-amd64

<Environment {'colors': 256,
 'config': {'default_options': ['--style=monokai']},
 'config_dir': PosixPath('/home/tiger-222/.httpie'),
 'devnull': <property object at 0x7f1b74dbb130>,
 'is_windows': False,
 'log_error': <function Environment.log_error at 0x7f1b74da9d30>,
 'program_name': '__main__.py',
 'stderr': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'stderr_isatty': True,
 'stdin': <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>,
 'stdin_encoding': 'utf-8',
 'stdin_isatty': True,
 'stdout': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
 'stdout_encoding': 'utf-8',
 'stdout_isatty': True}>

<PluginManager {'adapters': [<class 'httpie_snapdsocket.SnapdSocketTransportPlugin'>],
 'auth': [<class 'httpie.plugins.builtin.BasicAuthPlugin'>,
          <class 'httpie.plugins.builtin.DigestAuthPlugin'>],
 'converters': [],
 'formatters': [<class 'httpie.output.formatters.headers.HeadersFormatter'>,
                <class 'httpie.output.formatters.json.JSONFormatter'>,
                <class 'httpie.output.formatters.xml.XMLFormatter'>,
                <class 'httpie.output.formatters.colors.ColorFormatter'>]}>

>>> requests.request(**{'auth': None,
 'data': RequestJSONDataDict(),
 'headers': {'User-Agent': b'HTTPie/2.6.0.dev0'},
 'method': 'get',
 'params': <generator object MultiValueOrderedDict.items at 0x7f1b742d7510>,
 'url': 'http://pie.dev/get'})

HTTP/1.1 200 OK
CF-Cache-Status: DYNAMIC
CF-RAY: 69347a9b088fedbf-CDG
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json
Date: Thu, 23 Sep 2021 14:31:50 GMT
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Pi%2Bew9tk41cRrv9swQiYxozWzBIwPtMk8%2F0ZpzyYLO%2B1PEhq8%2Fk%2BqO8heSXy5JBRXsdpx%2Bw0e1RskVMsoQztEdvWywJzn0JfU4Ct2sHm6VZ2AkPN9G0pZPg7"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Transfer-Encoding: chunked
access-control-allow-credentials: true
access-control-allow-origin: *
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; ma=86400

{
    "args": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip",
        "Cdn-Loop": "cloudflare",
        "Cf-Connecting-Ip": "89.159.87.157",
        "Cf-Ipcountry": "FR",
        "Cf-Ray": "69347a9b088fedbf-FRA",
        "Cf-Visitor": "{\"scheme\":\"http\"}",
        "Connection": "Keep-Alive",
        "Host": "pie.dev",
        "User-Agent": "HTTPie/2.6.0.dev0"
    },
    "origin": "89.159.87.157",
    "url": "http://pie.dev/get"
}

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2021

Codecov Report

Merging #1165 (fd2735a) into master (4d7d6b6) will decrease coverage by 0.23%.
The diff coverage is 93.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1165      +/-   ##
==========================================
- Coverage   97.28%   97.05%   -0.24%     
==========================================
  Files          67       70       +3     
  Lines        4235     4341     +106     
==========================================
+ Hits         4120     4213      +93     
- Misses        115      128      +13     
Impacted Files Coverage Δ
tests/conftest.py 75.75% <50.00%> (-11.20%) ⬇️
tests/test_ssl.py 89.88% <63.63%> (-5.05%) ⬇️
httpie/output/formatters/colors.py 92.66% <83.33%> (-0.92%) ⬇️
httpie/__init__.py 100.00% <100.00%> (ø)
httpie/cli/requestitems.py 91.17% <100.00%> (ø)
httpie/core.py 92.30% <100.00%> (+0.10%) ⬆️
httpie/output/formatters/json.py 100.00% <100.00%> (ø)
httpie/output/lexers/http.py 100.00% <100.00%> (ø)
httpie/output/lexers/json.py 100.00% <100.00%> (ø)
httpie/output/utils.py 100.00% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1535d0c...fd2735a. Read the comment docs.

@BoboTiG BoboTiG merged commit 474093a into master Sep 23, 2021
@BoboTiG BoboTiG deleted the mickael/oss-66-include-plugin-info-in---debug-output branch September 23, 2021 15:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include plugin info in --debug output
2 participants