CKLogger

A inheritable and subscribable logger util.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/441386/1027348/CKLogger.js

Autor
CKylinMC
Verzija
1.0
Napravljeno
12/03/2022
Ažurirano
12/03/2022
Licenca
GPLv3 License

可订阅的多级控制台消息输出工具。

  • 自定义控制台消息提供者, logger.serviceProvider=console
  • 支持log/info/warn/error/debug,支持自定义输出方法
  • 可父子级输出日志, const childLogger = parentLogger.getSubLogger('childname')
  • 可禁用, logger.setVisible(false)
  • 可订阅, logger.subscribe({levels:['error','warn'],onlyVisible:true,includeSubLoggers:true,onlog:(level,namespace,...args)=>{/*do sth here*/}})