Debugger(labelopt, enabledopt)
Debug utility.
Constructor
new Debugger(labelopt, enabledopt)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
label opt
|
string |
[DEBUG]
|
Log label |
enabled opt
|
boolean |
true
|
Whether to enable debugging |
- License:
- Apache-2.0Copyright 2020 Satoshi Soma
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. - Source:
- src/scripts/Debugger.js, line 19
Methods
call(fn, …argsrpt) → any
Calls the given function.
Parameters:
Name | Type | Description |
---|---|---|
fn
|
function | Function to call |
args rpt
|
any | Arguments to pass to |
- Source:
- src/scripts/Debugger.js, line 54
Returns:
Return of fn
- Type:
- any
disable()
Disables debugging.
- Source:
- src/scripts/Debugger.js, line 37
enable()
Enables debugging.
- Source:
- src/scripts/Debugger.js, line 31
log(…argsrpt)
Outputs logs to console.
Parameters:
Name | Type | Description |
---|---|---|
args rpt
|
any | Infos to log |
- Source:
- src/scripts/Debugger.js, line 44
slow(weight)
Simulates a heavy computing operation.
Parameters:
Name | Type | Description |
---|---|---|
weight
|
number | How heavy |
- Source:
- src/scripts/Debugger.js, line 62