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

fix: improve ts output for create logger #8763

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"shelljs": "^0.8.5",
"shx": "^0.3.2",
"sinon": "^11.1.1",
"typescript": "^5.5.0-beta",
"typescript": "^5.5.1-rc",
"uglify-js": "^3.6.0",
"unified": "^7.0.2",
"videojs-generate-karma-config": "^8.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/js/utils/create-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ export default function createLogger(name, delimiter = ':', styles = '') {
* @param {...*} args
* One or more messages or objects that should be logged.
*/
const log = function(...args) {
function log(...args) {
logByType('log', level, args);
};
}

// This is the logByType helper that the logging methods below use
logByType = LogByTypeFactory(name, log, styles);

/**
* Create a new subLogger which chains the old name to the new name.
*
* For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:
* For example, doing `mylogger = videojs.log.createLogger('player')` and then using that logger will log the following:
* ```js
* mylogger('foo');
* // > VIDEOJS: player: foo
Expand Down