Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 74c160f

Browse files
committed
logging: remove useless ones, improve others
1 parent 21f39b0 commit 74c160f

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class P2PHLS extends HLS {
7474
}
7575

7676
onDecodeError() {
77-
log.warn("Error, decode error (" + this.currentChunk.length + ") Getting from CDN")
77+
log.warn("Error, decode error")
7878
this.resourceRequester.decodingError = true
7979
this.resourceRequester.requestResource(this.currentUrl, 0, (chunk, method) => this.resourceLoaded(chunk, method))
8080
}
@@ -102,8 +102,6 @@ class P2PHLS extends HLS {
102102
this.el.resourceLoaded(chunk)
103103
this.currentChunk = chunk
104104
this.playbackInfo.updateChunkStats(method)
105-
} else {
106-
log.warn("deadlock on resourceLoaded")
107105
}
108106
}
109107

src/resource_requester.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ResourceRequester extends BaseObject {
3131
}
3232

3333
requestToCDN() {
34-
log.info("From CDN: " + this.resource.match(/.*\/(.*.ts)/)[1])
3534
this.cdnRequester.requestResource(this.resource, this.callback)
3635
}
3736

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
Turn on/off logging on browser's console on
99
initialization. You can always turn on/off
1010
by pressing ctrl+shift+l on your browser tab. */
11-
logging: false,
11+
logging: true,
1212

1313
/* maxStorageChunks
1414
Maximum size of the storage in number of chunks. */

src/swarm.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class Swarm extends BaseObject {
6565
var timeout = this.playbackInfo.timeoutFor('interested')
6666
if (this.sender) {
6767
//already have a sender with success, requesting directly
68-
log.info("requesting directly to sender")
6968
this.interestedTimeoutID = setTimeout(this.sendRequest.bind(this), timeout)
7069
} else {
7170
this.sendTo('contributors', 'interested', resource)
@@ -95,7 +94,7 @@ class Swarm extends BaseObject {
9594
this.chokedClients += 1
9695
}
9796
if (this.chokedClients === _.size(this.utils.contributors) || this.sender !== undefined) {
98-
log.warn("choke received, getting from cdn")
97+
log.warn("Choked, getting from CDN")
9998
clearInterval(this.interestedTimeoutID)
10099
this.clearRequestFailInterval()
101100
this.callbackFail()
@@ -119,7 +118,7 @@ class Swarm extends BaseObject {
119118
// nothing could be worse than this. Someont sent you the entire chunk, but missed the time
120119
// and generated unnecessary traffic.
121120
peer.late += 1
122-
log.warn("satisfy error due timeout, peer late status: " + peer.late)
121+
log.warn("satisfy error due timeout, peer late status: " + peer.late + "(" + this.sender + "," + this.currentResource + ")")
123122
if (peer.late > 3) {
124123
this.busyReceived(peer)
125124
peer.late = 0

0 commit comments

Comments
 (0)