/** * Middleware que dá log no número de requisições */ function logRequests(req, res, next) { console.count("Número de requisições"); return next(); }
profile(arg: string) { if (LoopBackConfig.debuggable()) console.count(arg); }
/* eslint-env mocha, browser */ /* global proclaim */ describe('console', function () { it('count()', function () { proclaim.doesNotThrow(function () { console.count(); }); }); });
render() { console.count('render times') return ( <div> { this.state.matches.map((item, index) => { return ( <MatchCard key={ item.id } { ...item } onTitleClick={ this.removeMatchHandler } onJoinMatch={ this.joinMatchHandler } onOptOutMatch={ this.optOutMatchHandler } declination={ index % 2 ? 'Left' : 'Right' } /> ) }) } </div> ) }
componentDidUpdate() { console.count('update times') }
count(arg: string) { if (LoopBackConfig.debuggable()) console.count(arg); }
group(arg: string) { if (LoopBackConfig.debuggable()) console.count(arg); }
time(arg: string) { if (LoopBackConfig.debuggable()) console.count(arg); }
timeEnd(arg: string) { if (LoopBackConfig.debuggable()) console.count(arg); }