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

ControllerScriptEngineBase: install console extension #4174

Merged

Conversation

Swiftb0y
Copy link
Member

@Swiftb0y Swiftb0y commented Aug 4, 2021

This allows new scripts to use console.* functions which for example
enables easier debugging using Qt's debugging and logging tools.
See https://doc.qt.io/qt-5/qtquick-debugging.html#console-api for more information
on the console extension api.

I already suggested this while reviewing another PR: #4171 (comment)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1097682922

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 26.027%

Totals Coverage Status
Change from base Build 1097150390: 0.01%
Covered Lines: 20019
Relevant Lines: 76915

💛 - Coveralls

@Be-ing
Copy link
Contributor

Be-ing commented Aug 5, 2021

How about doing this in ControllerScriptEngineBase?

@Swiftb0y
Copy link
Member Author

Swiftb0y commented Aug 5, 2021

It was already one in the ModuleScriptEngine subclass as well. So I guess I can pull up both into the base class.

@Swiftb0y Swiftb0y force-pushed the legacy_controller_engine_console_extension branch from 64e896c to 6507dce Compare August 5, 2021 09:55
@Swiftb0y Swiftb0y changed the title ControllerScriptEngineLegacy: install console extension ControllerScriptEngineBase: install console extension Aug 5, 2021
This allows new scripts to use console.* functions which for example
enables easier debugging using Qt's debugging and logging tools.
See https://doc.qt.io/qt-5/qtquick-debugging.html#console-api for more information
on the console extension api.
@Swiftb0y Swiftb0y force-pushed the legacy_controller_engine_console_extension branch from 6507dce to 0d90636 Compare August 5, 2021 12:07
@Holzhaus
Copy link
Member

Holzhaus commented Aug 5, 2021

Can we replace print() in common-controller-scripts.js with console.log and remove the log() method of the controller engine?

@Be-ing Be-ing merged commit 1a96799 into mixxxdj:main Aug 5, 2021
@Be-ing
Copy link
Contributor

Be-ing commented Aug 5, 2021

Good idea to change common-controller-scripts.js. I'm not sure we should remove the old log function though. There is only one script in Mixxx that uses it for the Hercules DJ Console 4 Mx, but there might be old mappings on the forum using it. It doesn't hurt to keep it. Maybe we could change the implementation in ControllerScriptEngineLegacy to forward it to console.log though.

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.

4 participants