Skip to content

Commit

Permalink
less logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cubedro committed Oct 28, 2015
1 parent 33f6cd1 commit 946408f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ History.prototype.requiresUpdate = function()

History.prototype.getHistoryRequestRange = function()
{
if( this._items.length < 5 )
if( this._items.length < 2 )
return false;

var blocks = _.pluck( this._items, 'height' );
Expand Down
12 changes: 12 additions & 0 deletions lib/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ var typeColors = {
'PIN': chalk.reset.bold.yellow,
};

var verbosity = [
[],
['error'],
['error', 'warn', 'success'],
['info', 'error', 'warn', 'success', 'time', 'timeEnd']
];

var ENV_VERBOSITY = process.env.VERBOSITY || 2;

[
{
name: "info",
Expand Down Expand Up @@ -102,6 +111,9 @@ var typeColors = {

console[item.name] = function ()
{
if(verbosity[ENV_VERBOSITY].indexOf(fnName) === -1)

This comment has been minimized.

Copy link
@rodiazet

rodiazet Dec 22, 2015

Where is "fnName" defined? It seems that it's undefined.

This comment has been minimized.

Copy link
@ililic

ililic Dec 30, 2015

+1:

/home/igor/projects/eth-netstats/lib/utils/logger.js:114
        if(verbosity[ENV_VERBOSITY].indexOf(fnName) === -1)
                                            ^

ReferenceError: fnName is not defined
    at Console.console.(anonymous function) [as error] (/home/igor/projects/eth-netstats/lib/utils/logger.js:114:39)
    at Object.<anonymous> (/home/igor/projects/eth-netstats/app.js:28:11)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/igor/projects/eth-netstats/bin/www:3:11)
    at Module._compile (module.js:435:26)
return false;

var args = Array.prototype.slice.call(arguments);
var type = null,
sign,
Expand Down

0 comments on commit 946408f

Please sign in to comment.