AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
237 stars 20 forks source link

console doesn't log any custom loggings #157

Closed hffmnn closed 1 year ago

hffmnn commented 1 year ago

Hi.

Having this code in yac.rest:

GET https://httpbin.org/anything HTTP/1.1

{{
  // post request script
  console.error("this is it");
}}

and running it via the VS Code Extension via send, I'd expect to see the logging in the httpyac - Log console, but it is empty.

Running the same file with the CLI gives this output (which is what I expect):

❯ node node_modules/.bin/httpyac yac.rest

? please choose which region to use GET https://httpbin.org/anything (line: 1)

---------------------

GET https://httpbin.org/anything
accept: */*
accept-encoding: gzip, deflate, br
user-agent: httpyac

HTTP/1.1 200  - OK
access-control-allow-credentials: true
access-control-allow-origin: *
connection: close
content-length: 384
content-type: application/json
date: Sun, 23 Oct 2022 10:03:58 GMT
server: gunicorn/19.9.0

{
  "args": {},
  "data": "",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br",
    "Host": "httpbin.org",
    "User-Agent": "httpyac",
    "X-Amzn-Trace-Id": "Root=1-6355118e-46c4f3ee426419117579b053"
  },
  "json": null,
  "method": "GET",
  "origin": "78.48.110.162",
  "url": "https://httpbin.org/anything"
}
this is it

My httpyac settings via settings.json:

"httpyac.responseViewHeader": [
    "timings.total",
    "content-type",
    "content-length"
  ],
  "httpyac.responseViewContent": "exchange",
  "httpyac.environmentShowStatusBarItem": true,
  "httpyac.logLevel": "info",
  "httpyac.generateCodeTargetOutput": "clipboard",
  "httpyac.useRegionScopedVariables": false,

Did I miss anything?

AnWeber commented 1 year ago

I use a different output channel for console logs. I think it is httpyac - scriptconsole.

hffmnn commented 1 year ago

Ok, got it. It's httpyac - Console. Thanks a lot.