avoid logs polluting the unit test output

This commit is contained in:
El RIDO 2017-10-30 07:04:59 +01:00
parent 751731414e
commit 29419d03cd
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
4 changed files with 12 additions and 12 deletions

View File

@ -414,7 +414,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
var orgArguments = arguments; var orgArguments = arguments;
$(document).on(languageLoadedEvent, function () { $(document).on(languageLoadedEvent, function () {
// log to show that the previous error could be mitigated // log to show that the previous error could be mitigated
console.log('Fix missing translation of \'' + messageId + '\' with now loaded language ' + language); console.warn('Fix missing translation of \'' + messageId + '\' with now loaded language ' + language);
// re-execute this function // re-execute this function
me.translate.apply(this, orgArguments); me.translate.apply(this, orgArguments);
}); });
@ -1100,7 +1100,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
*/ */
me.showStatus = function(message, icon, dismissable, autoclose) me.showStatus = function(message, icon, dismissable, autoclose)
{ {
console.log('status shown: ', message); console.info('status shown: ', message);
// @TODO: implement dismissable // @TODO: implement dismissable
// @TODO: implement autoclose // @TODO: implement autoclose
@ -1143,7 +1143,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
*/ */
me.showRemaining = function(message) me.showRemaining = function(message)
{ {
console.log('remaining message shown: ', message); console.info('remaining message shown: ', message);
handleNotification(1, $remainingTime, message); handleNotification(1, $remainingTime, message);
} }
@ -1161,7 +1161,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showLoading = function(message, percentage, icon) me.showLoading = function(message, percentage, icon)
{ {
if (typeof message !== 'undefined' && message !== null) { if (typeof message !== 'undefined' && message !== null) {
console.log('status changed: ', message); console.info('status changed: ', message);
} }
// default message text // default message text
@ -2656,7 +2656,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showViewButtons = function() me.showViewButtons = function()
{ {
if (viewButtonsDisplayed) { if (viewButtonsDisplayed) {
console.log('showViewButtons: view buttons are already displayed'); console.warn('showViewButtons: view buttons are already displayed');
return; return;
} }
@ -2676,7 +2676,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.hideViewButtons = function() me.hideViewButtons = function()
{ {
if (!viewButtonsDisplayed) { if (!viewButtonsDisplayed) {
console.log('hideViewButtons: view buttons are already hidden'); console.warn('hideViewButtons: view buttons are already hidden');
return; return;
} }
@ -2708,7 +2708,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showCreateButtons = function() me.showCreateButtons = function()
{ {
if (createButtonsDisplayed) { if (createButtonsDisplayed) {
console.log('showCreateButtons: create buttons are already displayed'); console.warn('showCreateButtons: create buttons are already displayed');
return; return;
} }
@ -2733,7 +2733,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.hideCreateButtons = function() me.hideCreateButtons = function()
{ {
if (!createButtonsDisplayed) { if (!createButtonsDisplayed) {
console.log('hideCreateButtons: create buttons are already hidden'); console.warn('hideCreateButtons: create buttons are already hidden');
return; return;
} }

View File

@ -25,8 +25,8 @@ global.RawDeflate.inflate = require('./rawinflate-0.3').RawDeflate.inflate;
require('./privatebin'); require('./privatebin');
// redirect console messages to log file // redirect console messages to log file
console.warn = console.error = function (msg) { console.info = console.warn = console.error = function () {
logFile.write(msg + '\n'); logFile.write(Array.prototype.slice.call(arguments).join('') + '\n');
} }
describe('Helper', function () { describe('Helper', function () {

View File

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QHNQsevnuA9oHZp2BV0Bi/hyf99g6+H/C2BhSnmlbyxU1SFXiLQvu43xdEl8qvZSoS2zf0R6rgH0sbSeVsrqsQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-FyLKI8IhQHnJ24H05KGlzJGOht+xoMUj7Io5BL02qGUzdL6bXGPiQlmTOlbxAwDo0x+AP9m1pfGpI3UbC0T0sw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->

View File

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QHNQsevnuA9oHZp2BV0Bi/hyf99g6+H/C2BhSnmlbyxU1SFXiLQvu43xdEl8qvZSoS2zf0R6rgH0sbSeVsrqsQ==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-FyLKI8IhQHnJ24H05KGlzJGOht+xoMUj7Io5BL02qGUzdL6bXGPiQlmTOlbxAwDo0x+AP9m1pfGpI3UbC0T0sw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->