1 | /** |
||
2 | * [Siteapp] - multi-purpose frontend application |
||
3 | * |
||
4 | * Siteapp application logger |
||
5 | * |
||
6 | * @package [Siteapp] |
||
7 | * @subpackage [Siteapp] core |
||
8 | * @author Björn Bartels <[email protected]> |
||
9 | * @link https://gitlab.bjoernbartels.earth/groups/themes |
||
10 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 |
||
11 | * @copyright copyright (c) 2016 Björn Bartels <[email protected]> |
||
12 | * |
||
13 | * @namespace Siteapp |
||
14 | * @module Siteapp.Log |
||
15 | */ |
||
16 | |||
17 | var Log = { |
||
18 | logentries : [], |
||
19 | loglevel : 0, |
||
20 | logtypes : ['debug','info','warn','exception'], |
||
21 | _currentIndex : 0, |
||
22 | |||
23 | log : function ( message, type, context ) { this.logentries.push(arguments); return (this); }, |
||
0 ignored issues
–
show
|
|||
24 | get : function () { return (arguments.length > 0) ? this.logentries[parseInt(arguments[0])] : this.logentries; }, |
||
25 | clear : function () { this.logentries = []; this._currentIndex = 0; return (this); }, |
||
26 | |||
27 | setLevel : function () { if (arguments.length > 0) { this.loglevel = parseInt(arguments[0]); } else { this.loglevel = 0; } return (this); }, |
||
28 | |||
29 | _app : ( context ) => { |
||
30 | if (context) { |
||
31 | this.__app = context; |
||
0 ignored issues
–
show
|
|||
32 | } else { |
||
33 | return this.__app; |
||
34 | } |
||
35 | } |
||
36 | }; |
||
37 | |||
38 | export {Log}; |
||
39 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.