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

VBLOCKS-2473 fix logLevel param to accept strings #226

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

charliesantos
Copy link
Collaborator

@charliesantos charliesantos commented Dec 6, 2023

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Pull Request Details

VBLOCKS-2473

Burndown

Before review

  • Updated CHANGELOG.md if necessary
  • Added unit tests if necessary
  • Updated affected documentation
  • Verified locally with npm test
  • Manually sanity tested running locally
  • Ready for review

Before merge

  • Got one or more +1s
  • Squashed erroneous commits if necessary
  • Re-tested if necessary

* 0 = trace, 1 = debug, 2 = info, 3 = warn, 4 = error, 5 = silent
*
* Or any of the following strings:
* 'trace', 'debug', 'info', 'warn', 'error', 'silent'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, the same strings in all-caps are also valid in the logLevel library.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the types and only numbers and lower case strings are accepted

declare namespace log {
    /**
     * Log levels
     */
    interface LogLevel {
        TRACE: 0;
        DEBUG: 1;
        INFO: 2;
        WARN: 3;
        ERROR: 4;
        SILENT: 5;
    }

    /**
     * Possible log level numbers.
     */
    type LogLevelNumbers = LogLevel[keyof LogLevel];

    /**
     * Possible log level descriptors, may be string, lower or upper case, or number.
     */
    type LogLevelDesc = LogLevelNumbers
        | 'trace'
        | 'debug'
        | 'info'
        | 'warn'
        | 'error'
        | 'silent'
        | keyof LogLevel;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyof LogLevel would include the all-caps variants of the strings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah true! Let me update the doc

@charliesantos charliesantos merged commit eb7d03f into master Dec 7, 2023
6 of 7 checks passed
@charliesantos charliesantos deleted the VBLOCKS-2473 branch December 7, 2023 18:22
rgkeith3 pushed a commit to podium/twilio-voice.js that referenced this pull request Jan 17, 2024
* VBLOCKS-1155 Make sure publisher host is inited if home region exists (twilio#122)

* VBLOCKS-1155 Making sure publisher host is inited if home region is available

* Changelog and tests

* 2.1.2-rc1

* 2.1.2-dev

* Changelog date for 2.1.2 release

* 2.1.2

* 2.1.3-dev

* Feature/sdk eventing (twilio#129)

* feat: option for event registration; send option over vsp invite

* Update peerconnection.js

* [VBLOCKS-505] feat: sdk eventing; listener and event (twilio#112)

* feat: sdk eventing; listener and event

* fix: rename registerFor

* chore: unit tests

* feat: send message api (twilio#114)

* feat: send message api

* feat: address feedback

* fix: add callsid check

* fix: remove call status check

* VBLOCKS-981 VBLOCKS-1093 | Updating eventing API per latest specs (twilio#116)

* VBLOCKS-981 VBLOCKS-1093 | Updating eventing API per latest specs

* Adding note about the key

* VBLOCKS-1095 | Updating API docs

* Adding docs

* Addressed feedback

* [VBLOCKS-1127] Consume new SDK eventing errors (twilio#120)

* chore: update voice-error dependency

* fix: update voice-errors dep and generate new error classes

* Adding changelog draft (twilio#123)

* Adding changelog draft

* Adding Kumkum's suggestion.

* Syncing lock file version

* 2.2.0-rc1

* 2.2.0-dev

* Adding placeholder links to public docs

* VBLOCKS-1218 Adding 31209 error for max payload size limit (twilio#125)

* Updating gitignore for test webpack

* Fixing release pipeline: removing unused webpack test

* 2.2.0-rc2

* 2.2.0-dev

* Prep for release (twilio#128)

* Using latest errors

* Using latest errors

* Updating docs

* Update changelog

* Update changelog

Co-authored-by: Michael Huynh <mhuynh@twilio.com>
Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>
Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>

* 2.2.0-rc3

* 2.2.0-dev

* Adding release date

* 2.2.0

* 2.2.1-dev

* Update copyrightL 2021 -> 2023

* Feature/voice js dns (twilio#138)

* Update gitignore

* VBLOCKS-1086 Use voice-js DNS names directly (twilio#119)

* VBLOCKS-1086 Use voice-js DNS names directly

* Update CSP policies

* Adding changelog

* Updating tests

* Updating lockfile

* 2.3.0-rc1

* 2.3.0-dev

* Prep for release. Adding release date.

Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>

* Syncing lockfile version

* 2.3.0

* 2.3.1-dev

* fix(incoming-sound): stop incoming sound when the call gets disconnected (twilio#134)

* fix(incoming-sound): stop incoming sound when the call gets disconnected

* test(incoming-sound): add a unit test to cover the fixed bug

* test: cover missing incoming sound unit tests

---------

Co-authored-by: Kamal Bennani <kamal.bennani@aircall.io>

* Add 2.3.1 changelog entry (twilio#141)

* Syncing package-lock.json

* 2.3.1-rc1

* 2.3.1-dev

* Setting date for release

* 2.3.1

* 2.3.2-dev

* GH95 | error is not returned when mic access is blocked (twilio#144)

* GH95 | error is not returned when mic access is blocked

* PR Review

* Syncing lock file version for RC

* 2.3.2-rc1

* 2.3.2-dev

* Set date for the release

* 2.3.2

* 2.3.3-dev

* VBLOCKS-1371 | Remove handlers for rejected calls (twilio#149)

* VBLOCKS-1371 | Remove handlers for rejected calls

* Unit tests

* Uploading test coverage (twilio#150)

* VBLOCKS-1534 | Stop using deprecated RTCIceCandidateStats (twilio#152)

* VBLOCKS-1111 | Fix sound definitions (twilio#153)

* VBLOCKS-1534 | Stop using deprecated RTCIceCandidateStats

* VBLOCKS-1111 | Fix sound definitions

* Tests and changelog

* Update docs

* VBLOCKS-1473 | Fix PeerConnection leak (twilio#154)

* Remove unnecessary bind

* Tests and changelog

* VBLOCKS-1269 | Don't dispatch deviceinfochange indefinitely (twilio#155)

* Don't unnecessary emit deviceinfochange

* Exporting mediadevices properly

* Only init nativeMediaDevices before instantiation

* Lint

* Properly initing

* Tests

* Changelog

* Adding todo note

* Review comments

* Prep for RC: Sync lockfile version

* 2.4.0-rc1

* 2.4.0-dev

* Update CircleCI Badge link

* Prep for release: Changelog date and syncing lockfile version

* 2.4.0

* 2.4.1-dev

* VDI Support 2.x initial implementation (twilio#158)

* VDI Support initial implementation

* Rename connection -> call

* Updating documentation to prevent setRemoteDescription error (twilio#160)

* Syncing lockfile version for RC

* Adding build checks to the ci pipeline (twilio#161)

* 2.5.0-rc1

* 2.5.0-dev

* Add changelog for release

* 2.5.0

* 2.5.1-dev

* Adding daily builds

* VBLOCKS-1716 | Convert JS pipeline to TS (twilio#166)

* VBLOCKS-1716 | Convert JS pipeline to TS

* Update CHANGELOG.md

* VBLOCKS-1718 | Remove default node modules (twilio#167)

* VBLOCKS-1716 | Convert JS pipeline to TS

* Update npmignore

* adding browser events and removing backoff

* Adding backoff module

* Use new backoff in call class

* Use new backoff in wstransport

* lint

* fix tsdocs

* Adding changelog

* Adding tests

* adding test file

* Updating changelog

* 2.6.0-rc1

* 2.6.0-dev

* VBLOCKS-1578 | Adding typechecks to all public APIs (twilio#168)

* VBLOCKS-1578 | Adding typechecks to all public APIs

* Remove unnecessary file

* VBLOCKS-1301 Support node versions 16 and above. (twilio#169)

* VBLOCKS-1301 Support node versions 16 and above.
* VBLOCKS-1301 Removing --legacy-peer-deps flag from circleci jobs.
* VBLOCKS-1301 Updating package "twilio" to 3.84.1, which does not depend on express. Hence, no need to add the "types" config to the TypeScript compiler.

* VBLOCKS-1301 Remove ws and xmlhttprequest dependencies. (twilio#170)

* VBLOCKS-1301 Remove ws and xmlhttprequest dependencies.

* VBLOCKS-1301 Remove options from request() and ws import from wstransport.ts.

* VBLOCKS-1767 | Migrate AudioPlayer (twilio#171)

* 2.6.0-rc2

* 2.6.0-dev

* Changelog for 2.0.6 (twilio#174)

* Changelog for 2.0.6

* Adding review suggestion

* Adding Kumkum's suggestion.

* 2.6.0

* 2.6.1-dev

* VBLOCKS-1805 | Fix dtmf tones overrides (twilio#176)

* VBLOCKS-1805 | Fix dtmf tones overrides

* Address feedback

* VBLOCKS-1808 Trimming dependencies + require => import. (twilio#175)

* VBLOCKS-1808 Removing some unwanted dependencies.
* VBLOCKS-1808 Removing deprecated dependencies as much as possible.
* VBLOCKS-1808 s/require/import/g wherever possible.

* VBLOCKS-1299 | Making all integration tests green (twilio#177)

* 2.6.1-rc1

* 2.6.1-dev

* (GH178) fix(audio): Persist enabled sounds state (twilio#179)

* test: change the test to reflect the reality

* fix(audio): persist enabled sounds state when calling device.updateOptions

* docs: update changelog

* docs: make the enabled sounds getter as private

---------

Co-authored-by: Kamal Bennani <kamal.bennani@aircall.io>

* 2.6.1-rc2

* 2.6.1-dev

* VBLOCKS-1818 | Adding healthchecks and posting failures to slack (twilio#180)

* VBLOCKS-1818 | Adding healthchecks and posting failures to slack

* Adding build url

* Keeping integration test npm script

* Adjust flaky test (twilio#181)

* Adding date for release

* 2.6.1

* 2.6.2-dev

* VBLOCKS-1301 Add esm output. (twilio#182)

* VBLOCKS-1301 Add esm output.
* VBLOCKS-1301 Adding es6 module check and updating .release.json and config.yml.

* Sync lock file for RC

* 2.7.0-rc1

* 2.7.0-dev

* Update CHANGELOG.md for ESM (twilio#184)

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Manjesh Malavalli <mmalavalli@twilio.com>

---------

Co-authored-by: Manjesh Malavalli <mmalavalli@twilio.com>

* Adding changelog date and sync lockfile version for release

* Fix CI caching issue

* Adding arch info to fix caching issue on ci

* 2.7.0

* 2.7.1-dev

* VBLOCKS-1980 If md5 is exported as a default, then use it. (twilio#185)

* RC Prep: Sync lock file version.

* 2.7.1-rc1

* 2.7.1-dev

* Add important message regarding new DNS/IP in changelog

Approved here https://twilio.slack.com/archives/C020DUH6R1B/p1691091612273979

* Add 2.7.1 changelog (twilio#186)

* 2.7.1

* 2.7.2-dev

* Update CHANGELOG.md (twilio#194)

* VBLOCKS-2175 | Fix events docs (twilio#195)

* VBLOCKS-2175 | Fix events documentation

* Adding changelog

* Update call.ts

* Update device.ts

* Remove broken support email (twilio#198)

* Remove broken support email

* Update README.md

* Update README.md

* VBLOCKS-2214 | Remove unnecessary enumerateDevices calls (twilio#199)

* VBLOCKS-2214 | Remove unnecessary enumerateDevices calls

* changelog

* Using callback instead

* Changelog tweak

* RC prep: syncing lock file

* 2.7.2-rc1

* 2.7.2-dev

* Release prep: Changelog date

* 2.7.2

* 2.7.3-dev

* VBLOCKS-1690 Call reconnect() only when pstream is not null. (twilio#203)

* VBLOCKS-1690 Call reconnect() only when pstream is not null.

* VBLOCKS-1690 Add unit tests.

* VIDEO-1690 Add changelog entry.

* RC Prep: Sync lock file

* 2.7.3-rc1

* 2.7.3-dev

* Release prep: Changelog date

* 2.7.3

* 2.7.4-dev

* VBLOCKS-2054 | Missing generated errors (twilio#209)

* [VBLOCKS-2054] Missing generated errors (twilio#192)

* feat: add errors and unit tests to check for missing errors

* docs: changelog entry

* fix: call hangup handler

* docs: update changelog

* feat: add error feature flag and handling

* chore: unit tests

* chore: update voice errors version

* feat: add new errors to generation scripts

* chore: commit generated errors

* fix: add error codes to feature flag set

* docs: update changelog entry

* docs: update docstring for option

* docs: less enthusiasm

* fix: rename variables and functions

* fix: rename test case

* chore: bump versions (twilio#206)

* 2.8.0-rc1

* 2.8.0-dev

---------

Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>
Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>

* Release prep: Changelog date

* 2.8.0

* 2.8.1-dev

* Update 2.7.2 CHANGELOG.md to reflect Sonoma issue. (twilio#211)

* Merge AudioProcessor feature (twilio#217)

* VBLOCKS-2030 | API stubs and error checking (twilio#202)

* AudioProcessor interface

* Adding add and remove api

* lint

* Address PR reviews

* Update audiohelper.ts

* VBLOCKS-2180 | AudioProcessor implementation (twilio#207)

* AudioProcessor interface

* Adding add and remove api

* lint

* Making sure newStream is saved

* moving gUM call into one source

* progress

* progress: reviewing diffs

* Rename to be more specific

* stop stream

* Processed stream default

* progress

* Progress

* working version

* Removing unnecessary firefox check

* Restart streams on selected

* restart default stream

* logs

* VBLOCKS-2032 | AudioProcessor insights and reusing AudioHelper (twilio#213)

* Build checks fix (twilio#214)

* lint

* Temporary disabling unit tests

* 2.9.0-rc1

* 2.9.0-dev

* VBLOCKS-2031 VBLOCKS-2412 | Tests and Promise return type (twilio#216)

* RC Prep: sync lock file version

* 2.9.0-rc2

* 2.9.0-dev

---------

Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>

* VBLOCKS-2033 | AudioProcessor docs

* 2.9.0-rc3

* 2.9.0-dev

* 2.9.0

* 2.9.1-dev

* Fix client vs voice references (twilio#223)

* VBLOCKS-1850 Add and improve debug logs (twilio#221) (twilio#224)

* VBLOCKS-1850 Add and improve debug logs

* Lint and tests

* Changelog

* VBLOCKS-1559 Fix InvalidState error after updating token (twilio#225)

* VBLOCKS-1559 Fix InvalidState error after updating token

* Update tests/unit/device.ts

Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>

---------

Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>

* VBLOCKS-2473 fix logLevel param to accept strings (twilio#226)

* VBLOCKS-1850 Add and improve debug logs (twilio#221)

* VBLOCKS-1850 Add and improve debug logs

* Lint and tests

* Changelog

* VBLOCKS-1559 Fix InvalidState error after updating token

* VBLOCKS-2473 fix logLevel param to accept strings

* Update docs

* VBLOCKS-2461 fix call.mute() to also work during ringing or connecting (twilio#227)

* VBLOCKS-1850 Add and improve debug logs (twilio#221)

* VBLOCKS-1850 Add and improve debug logs

* Lint and tests

* Changelog

* VBLOCKS-1559 Fix InvalidState error after updating token

* VBLOCKS-2473 fix logLevel param to accept strings

* VBLOCKS-2461 fix call.mute() to also work during ringing or connecting

* Update copyright year (twilio#235)

* RC prep: Sync package-lock.json

* 2.10.0-rc1

* 2.10.0-dev

* Release prep: changelog date and sync package-lock.json

* 2.10.0

* Build

---------

Co-authored-by: Charlemagne Santos <csantos@twilio.com>
Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>
Co-authored-by: Michael Huynh <mhuynh@twilio.com>
Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>
Co-authored-by: Kamal Bennani <kamalbouchboy1@hotmail.fr>
Co-authored-by: Kamal Bennani <kamal.bennani@aircall.io>
Co-authored-by: Manjesh Malavalli <mmalavalli@twilio.com>
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 this pull request may close these issues.

2 participants