Utility functions for debugging
- Description:
Utility functions for debugging
- Source:
Methods
(static) attachLogToFunc(func) → {T}
- Description:
为函数添加调试日志包装,自动记录函数调用前后的参数和返回值
- Source:
Example
import { attachLogToFunc } from 'nsuite
attachLogToFunc(console.log)("hello world")
Parameters:
Name | Type | Description |
---|---|---|
func |
T | 需要被包装的目标函数 |
Returns:
包装后的函数,调用时会先打印入参日志,执行后打印返回值日志
- Type
- T