Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

data is stringified even though data is set to false #102

Closed
Tracked by #103
alex-marczinek opened this issue Nov 23, 2021 · 2 comments · Fixed by #114
Closed
Tracked by #103

data is stringified even though data is set to false #102

alex-marczinek opened this issue Nov 23, 2021 · 2 comments · Fixed by #114
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@alex-marczinek
Copy link

alex-marczinek commented Nov 23, 2021

Describe the bug

Set the data config to false :
setGlobalConfig({ data: false, });

With version 2.5.0 there was no error thrown when logging requests where the data field contained circular data.
Since version 2.6.0 however the data field will be stringified even though data is set to false:

See 'string-builder.ts':

 makeData(data: object) {
      const str = typeof data === `string` ? data : JSON.stringify(data);
      if(this.config.data && data) this.printQueue.push(str);
      return this;
}

I would suggest to only stringify the data if this.config.data is true.

@hg-pyun hg-pyun assigned hg-pyun and unassigned hg-pyun Nov 24, 2021
@hg-pyun hg-pyun added the bug Something isn't working label Nov 24, 2021
@hg-pyun
Copy link
Owner

hg-pyun commented Nov 24, 2021

Thank you for report. I will check and fix. It will be release on 2.6.1 soon.

@hg-pyun hg-pyun added the good first issue Good for newcomers label Nov 24, 2021
@hg-pyun hg-pyun mentioned this issue Nov 29, 2021
3 tasks
bricka added a commit to bricka/axios-logger that referenced this issue Jun 29, 2022
@bricka
Copy link
Contributor

bricka commented Jun 29, 2022

I've just put up a PR to fix this: #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants