method of static class JsNgram
Description
Custom log function with verbose level.
Example
JsNgram.log.v1('level 1 debugging message: ', x);
Usage
log.v0(obj1[, obj2, ... ]);
log.v1(obj1[, obj2, ... ]);
log.v2(obj1[, obj2, ... ]);
log.v3(obj1[, obj2, ... ]);
When verbose = 1
, log.v0
and log.v1
act as console.log
.
On the other hand log.v2
and log.v3
do nothing.
The log.v0
is always as same as console.log
.
Inner Class Log
The log
method is an instance of inner class Log
.
It has methods v0
, v1
, v2
and v3
.
The class is initialized with verbose level.
And the instance will have fixed rolls on these four methods.
When property verbose
changed
A new instance of the inner class Log
is generated with the new verbose level.
This new instance is set as the method log
.