Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Remove ad-hoc logging in favor of a config-enabled logging like playback-watcher #1014

Merged
merged 2 commits into from
Feb 16, 2017

Conversation

imbcmdth
Copy link
Member

Pretty self-explanatory. The original logging wasn't meant to be a permanent solution.

@mjneil
Copy link
Contributor

mjneil commented Feb 16, 2017

Changes need to be made in MasterPlaylistController so that the debug option is added onto the settings object passed to the segment loaders as well as a settings object needs to be passed to the sync controller

@@ -477,19 +468,21 @@ export default class SegmentLoader extends videojs.EventTarget {
return null;
}

this.logger_('cB_', 'mediaIndex:', mediaIndex, 'hasPlayed:', hasPlayed, 'currentTime:', currentTime, 'syncPoint:', syncPoint, 'fetchAtBuffer:', this.fetchAtBuffer_, 'bufferedTime:', bufferedTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

Really long line

Copy link
Contributor

Choose a reason for hiding this comment

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

And it might be a good idea to just write out checkBuffer_

@@ -522,7 +515,7 @@ export default class SegmentLoader extends videojs.EventTarget {
mediaIndex = mediaSourceInfo.mediaIndex;
startOfSegment = mediaSourceInfo.startTime;
}
log('gMIFT', mediaIndex, 'sos', startOfSegment);
this.logger_('gMIFT', mediaIndex, 'sos', startOfSegment);
Copy link
Contributor

Choose a reason for hiding this comment

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

While changing, would be good to write out getMediaIndexForTime

*
* @private
*/
logger_() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of writing this function and the check for the debug setting in each module we want to log, we should just have the actual logger passed in, and check for the debug option at the highest level.

Copy link
Member Author

Choose a reason for hiding this comment

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

I plan on doing this later by pulling in Pat's logger/history thing. This change was just to get rid of that ugly hack since we already have support for a less-ugly option in playback-watcher.

@imbcmdth
Copy link
Member Author

@mjneil Right now we are using global videojs HLS options for this. The settings object remains unchanged but the merger with the global options brings the debug flag. I decided to remove the options for sync-controller since it wasn't being used anyway.

@imbcmdth imbcmdth merged commit f323d26 into master Feb 16, 2017
@forbesjo forbesjo deleted the better-logging branch July 13, 2017 19:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants