`console.warn` and `info` instead of `log`

This commit is contained in:
meow 2022-04-20 16:36:03 +03:00
parent 026ea52445
commit 3431a1b1de
6 changed files with 28 additions and 28 deletions

View File

@ -96,7 +96,7 @@ function get_youtube_replies(target, load_more) {
};
xhr.ontimeout = function () {
console.log('Pulling comments failed.');
console.warn('Pulling comments failed.');
body.innerHTML = fallback;
};

View File

@ -5,7 +5,7 @@ function get_playlist(plid, retries) {
if (retries === undefined) retries = 5;
if (retries <= 0) {
console.log('Failed to pull playlist');
console.warn('Failed to pull playlist');
return;
}
@ -62,12 +62,12 @@ function get_playlist(plid, retries) {
};
xhr.onerror = function () {
console.log('Pulling playlist failed... ' + retries + '/5');
console.warn('Pulling playlist failed... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
};
xhr.ontimeout = function () {
console.log('Pulling playlist failed... ' + retries + '/5');
console.warn('Pulling playlist failed... ' + retries + '/5');
get_playlist(plid, retries - 1);
};

View File

@ -25,12 +25,12 @@ function get_subscriptions(callback, retries) {
};
xhr.onerror = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5');
console.warn('Pulling subscriptions failed... ' + retries + '/5');
setTimeout(function () { get_subscriptions(callback, retries - 1); }, 1000);
};
xhr.ontimeout = function () {
console.log('Pulling subscriptions failed... ' + retries + '/5');
console.warn('Pulling subscriptions failed... ' + retries + '/5');
get_subscriptions(callback, retries - 1);
};
@ -54,7 +54,7 @@ function create_notification_stream(subscriptions) {
}
var notification = JSON.parse(event.data);
console.log('Got notification:', notification);
console.info('Got notification:', notification);
if (start_time < notification.published && !delivered.includes(notification.videoId)) {
if (Notification.permission === 'granted') {
@ -90,7 +90,7 @@ function create_notification_stream(subscriptions) {
}
function handle_notification_error(event) {
console.log('Something went wrong with notifications, trying to reconnect...');
console.warn('Something went wrong with notifications, trying to reconnect...');
notifications = { close: function () { } };
setTimeout(function () { get_subscriptions(create_notification_stream); }, 1000);
}

View File

@ -280,7 +280,7 @@ player.on('volumechange', function () {
player.on('waiting', function () {
if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) {
console.log('Player has caught up to source, resetting playbackRate.');
console.info('Player has caught up to source, resetting playbackRate.');
player.playbackRate(1);
}
});
@ -477,7 +477,7 @@ function set_all_video_times(times) {
try {
storage.setItem(save_player_pos_key, JSON.stringify(times));
} catch (e) {
console.debug('set_all_video_times: ' + e);
console.warn('set_all_video_times: ' + e);
}
} else {
storage.removeItem(save_player_pos_key);
@ -492,7 +492,7 @@ function get_all_video_times() {
try {
return JSON.parse(raw);
} catch (e) {
console.debug('get_all_video_times: ' + e);
console.warn('get_all_video_times: ' + e);
}
}
}

View File

@ -14,7 +14,7 @@ function subscribe(retries) {
if (retries === undefined) retries = 5;
if (retries <= 0) {
console.log('Failed to subscribe.');
console.warn('Failed to subscribe.');
return;
}
@ -40,12 +40,12 @@ function subscribe(retries) {
};
xhr.onerror = function () {
console.log('Subscribing failed... ' + retries + '/5');
console.warn('Subscribing failed... ' + retries + '/5');
setTimeout(function () { subscribe(retries - 1); }, 1000);
};
xhr.ontimeout = function () {
console.log('Subscribing failed... ' + retries + '/5');
console.warn('Subscribing failed... ' + retries + '/5');
subscribe(retries - 1);
};
@ -57,7 +57,7 @@ function unsubscribe(retries) {
retries = 5;
if (retries <= 0) {
console.log('Failed to subscribe');
console.warn('Failed to subscribe');
return;
}
@ -83,12 +83,12 @@ function unsubscribe(retries) {
};
xhr.onerror = function () {
console.log('Unsubscribing failed... ' + retries + '/5');
console.warn('Unsubscribing failed... ' + retries + '/5');
setTimeout(function () { unsubscribe(retries - 1); }, 1000);
};
xhr.ontimeout = function () {
console.log('Unsubscribing failed... ' + retries + '/5');
console.warn('Unsubscribing failed... ' + retries + '/5');
unsubscribe(retries - 1);
};

View File

@ -121,7 +121,7 @@ function get_playlist(plid, retries) {
var playlist = document.getElementById('playlist');
if (retries <= 0) {
console.log('Failed to pull playlist');
console.warn('Failed to pull playlist');
playlist.innerHTML = '';
return;
}
@ -194,7 +194,7 @@ function get_playlist(plid, retries) {
playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
console.log('Pulling playlist timed out... ' + retries + '/5');
console.warn('Pulling playlist timed out... ' + retries + '/5');
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
};
@ -203,7 +203,7 @@ function get_playlist(plid, retries) {
playlist.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
console.log('Pulling playlist timed out... ' + retries + '/5');
console.warn('Pulling playlist timed out... ' + retries + '/5');
get_playlist(plid, retries - 1);
};
@ -215,7 +215,7 @@ function get_reddit_comments(retries) {
var comments = document.getElementById('comments');
if (retries <= 0) {
console.log('Failed to pull comments');
console.warn('Failed to pull comments');
comments.innerHTML = '';
return;
}
@ -265,7 +265,7 @@ function get_reddit_comments(retries) {
comments.children[0].children[1].children[0].onclick = swap_comments;
} else {
if (video_data.params.comments[1] === 'youtube') {
console.log('Pulling comments failed... ' + retries + '/5');
console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
} else {
comments.innerHTML = fallback;
@ -275,12 +275,12 @@ function get_reddit_comments(retries) {
};
xhr.onerror = function () {
console.log('Pulling comments failed... ' + retries + '/5');
console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_reddit_comments(retries - 1); }, 1000);
};
xhr.ontimeout = function () {
console.log('Pulling comments failed... ' + retries + '/5');
console.warn('Pulling comments failed... ' + retries + '/5');
get_reddit_comments(retries - 1);
};
@ -292,7 +292,7 @@ function get_youtube_comments(retries) {
var comments = document.getElementById('comments');
if (retries <= 0) {
console.log('Failed to pull comments');
console.warn('Failed to pull comments');
comments.innerHTML = '';
return;
}
@ -349,14 +349,14 @@ function get_youtube_comments(retries) {
xhr.onerror = function () {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5');
console.warn('Pulling comments failed... ' + retries + '/5');
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
};
xhr.ontimeout = function () {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
console.log('Pulling comments failed... ' + retries + '/5');
console.warn('Pulling comments failed... ' + retries + '/5');
get_youtube_comments(retries - 1);
};
@ -417,7 +417,7 @@ function get_youtube_replies(target, load_more, load_replies) {
};
xhr.ontimeout = function () {
console.log('Pulling comments failed.');
console.warn('Pulling comments failed.');
body.innerHTML = fallback;
};