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

Return typescript types back #654

Closed
aleksandrlat opened this issue Dec 15, 2020 · 6 comments · Fixed by #662
Closed

Return typescript types back #654

aleksandrlat opened this issue Dec 15, 2020 · 6 comments · Fixed by #662

Comments

@aleksandrlat
Copy link

Some types and enums were removed
https://github.com/DataDog/browser-sdk/pull/630/files#diff-0a7a0b18b6e69b1211c9c7ae7d3c838a36d248db33f06f4c6cb997818ad7aba6

We need to duplicate some types now. Please return them back.

@aleksandrlat
Copy link
Author

Can/should we use something like this now?

import { StatusType } from '@datadog/browser-logs/esm/domain/logger'

@bcaudan
Copy link
Contributor

bcaudan commented Dec 16, 2020

Hi @aleksandrlat,

Our intention was to facilitate the use of our APIs by replacing enum type by string union and enum value by string.
before:

import { StatusType, datadogLogs } from '@datadog/browser-logs'

datadogLogs.logger.log('message', {}, StatusType.error)

after:

import { datadogLogs } from '@datadog/browser-logs'

datadogLogs.logger.log('message', {}, 'error')

We could still export the values if it is helpful though.
Would that suit your usage or is there another issue?

@aleksandrlat
Copy link
Author

aleksandrlat commented Dec 17, 2020

Thank you @bcaudan!

We have our wrapper around your lib. And it is helpful to use these types in wrapper or code related to it.

We don't need the values, enums or any other kinds of objects. But it would be great to have types.

@bcaudan
Copy link
Contributor

bcaudan commented Dec 18, 2020

Oh interesting, would you mind sharing the purpose of the wrapper and how you wrap the lib?

@aleksandrlat
Copy link
Author

@bcaudan first of all we have our logger and datadog is only part of our logger. We abstract away datadog by our logger.
Second we have throttling in logger and group same errors into one.

@BenoitZugmeyer
Copy link
Member

This issue is addressed by PR #662 and will be released shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants