projs / console
v0.0.1
2022-09-04 12:29 UTC
This package is not auto-updated.
Last update: 2024-09-30 20:11:11 UTC
README
最新版
<script src="https://philippn.com/vendor/console/dist.js"></script>
某个版本
<script src="https://philippn.com/vendor/console/v0.0.1/dist.js"></script>
Composer (PHP Packagist)
composer require projs/console
<script src="/vendor/projs/console/dist.js"></script>
NPM @todo
◦ 使用
配置
const Console = new _Console();
Console
//.setWriteToConsole(true) // Control the whole output in browser console
//.setWarn(false) // Use a simple 'console.log()' (no backtrace included), otherwise 'console.warn()'
//.setDebug(true) // Use JS 'debugger'
.setLevels(['click', 'watch']) // 'placeholder' not included by default
;
默认使用方法
Console.log('Text here', 'Text here2'); // Output is optional here
仅显示占位符
Console.setLevels(['placeholder']); // Other levels are not logged
Console.placeholder(); // Other levels are not logged
显示占位符和某个级别
Console.setLevels(['watch', 'placeholder']);
Console.level('watch', 'Text here'); // Output is optional here
Console.placeholder('Text here');
强制记录日志
Console._log('Text here'); // Output is optional here
强制记录日志和调试信息
Console.__log('Text here'); // Output is optional here