Skip to content

Commit

Permalink
fix console logging
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbendell committed Feb 21, 2021
1 parent 29a19bd commit 19b1509
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "homebridge-blink-for-home",
"displayName": "Blink for Home",
"private": false,
"version": "3.7.0",
"version": "3.7.1",
"description": "Blink for Home Cameras for homebridge",
"license": "MIT",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/blink-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ class BlinkAPI {
if (/application\/json/.test(res.headers.get('content-type'))) {
const json = await res.json();
res._body = json; // stash it for the cache because .json() isn't re-callable
console.debug(JSON.stringify(json));
this.log.debug(JSON.stringify(json));
}
else if (/text/.test(res.headers.get('content-type'))) {
const txt = await res.text();
res._body = txt; // stash it for the cache because .json() isn't re-callable
console.debug(txt);
this.log.debug(txt);
}
else {
// TODO: what happens if the buffer isn't fully consumed?
Expand Down
4 changes: 2 additions & 2 deletions src/blink-camera-deligate.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class BlinkCameraDelegate {
// TODO: this is messy as hell - massive cleanup necessary
const liveViewURL = await this.blinkCamera.getLiveViewURL();

console.log(`LiveView Stream: ${liveViewURL}`);
this.log(`LiveView Stream: ${liveViewURL}`);
if (/^rtsp/.test(liveViewURL)) {
const [, protocol, host, path] = /([a-z]+):\/\/([^:/]+)(?::[0-9]+)?(\/.*)/.exec(liveViewURL) || [];
const ports = await reservePorts({count: 1});
Expand Down Expand Up @@ -300,7 +300,7 @@ class BlinkCameraDelegate {
}
else if (request.type === StreamRequestTypes.STOP) {
const ffmpegProcess = this.ongoingSessions.get(sessionID);
if (rtspProxy.proxyServer) await rtspProxy.proxyServer?.stop()?.catch(e => console.error(e));
if (rtspProxy.proxyServer) await rtspProxy.proxyServer?.stop()?.catch(e => this.log.error(e));
try {
if (ffmpegProcess) {
ffmpegProcess.kill('SIGKILL');
Expand Down
4 changes: 2 additions & 2 deletions src/blink.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ class Blink {
}
catch (e) {
// network error? just eat it and retry later
console.error(e);
this.log.error(e);
return false;
}
}
Expand Down Expand Up @@ -832,7 +832,7 @@ class Blink {
}
catch (e) {
// network error? just eat it and retry later
console.error(e);
this.log.error(e);
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Http2TLSTunnel {
this._rest = this._rest.slice(index);
// We have a single line here! Prepend the string we want
this.push(Buffer.from(line));
console.log(line.trimEnd());
// console.debug(line.trimEnd());
}

return void done();
Expand Down Expand Up @@ -105,12 +105,12 @@ class Http2TLSTunnel {
isPlay = true;
}
else {
console.log(data.toString());
// console.debug(data.toString());
}
});

tlsSocket.on('data', function(data) {
if (!isPlay) console.log(data.toString());
// if (!isPlay) console.debug(data.toString());
});
});

Expand Down

0 comments on commit 19b1509

Please sign in to comment.