hg-pyun / axios-logger

Beautify Axios Logging Messages
MIT License
173 stars 33 forks source link

formatting is not as advertized #60

Closed xenoterracide closed 4 years ago

xenoterracide commented 4 years ago

documentation suggests I should get

POST http://.../api/3.0/drink/pickup {...}

instead I get

    [Axios][Request] 2020-06-30T14:57:51-0500 3.0/drink/pickup POST {"order_id":851869,"code":"123"}

the lack of the baseurl is problematic for me as I was just sending to the wrong url


  axios.interceptors.request.use((req) => {
    return requestLogger(req, {
      method: true,
      url: true,
    });
  }, errorLogger);
  axios.interceptors.response.use(responseLogger, errorLogger);```
hg-pyun commented 4 years ago

Am I right to understand?

As-Is

POST 3.0/drink/pickup

To-Be

POST http://.../api/3.0/drink/pickup
xenoterracide commented 4 years ago

yes, that's what the documentation describes, I suppose I can give the full axios configuration if needed. Also

As-Is

3.0/drink/pickup POST

POST is coming after the url currently

ClintEsteMadera commented 4 years ago

I needed the method first, then the URL (as usually seen in REST APIs) so I went ahead and made the change. It's not entirely what this issue is about but at least, it should help... See https://github.com/hg-pyun/axios-logger/pull/63

hg-pyun commented 3 years ago

It update on 2.6.0 version.