跳至主要內容

Class: logger

muzzik大约 1 分钟

index / logger

Class: logger

日志打印器

Remarks

单例对象打印名为 default

  • 支持多实例

  • 打印等级控制

  • 打印屏蔽控制

  • 报错日志 http 上传

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new logger(name_s_)

Parameters

NameType
name_s_string

Overrides

instance_base.constructor

Defined in

assets/@framework/mk_logger.ts:63open in new window

Properties

config

Static config: global_config

全局配置

Defined in

assets/@framework/mk_logger.ts:151open in new window

Methods

only

Static only(module_ss_): void

只限模块打印

Parameters

NameTypeDescription
module_ss_string[]模块名列表

Returns

void

Remarks

调用时会覆盖 mk_logger.limit 的规则

Defined in

assets/@framework/mk_logger.ts:197open in new window


limit

Static limit(module_ss_): void

限制模块打印

Parameters

NameTypeDescription
module_ss_string[]模块名列表

Returns

void

Remarks

调用时会覆盖 mk_logger.only 的规则

Defined in

assets/@framework/mk_logger.ts:208open in new window


debug

debug(...args_as_): void

Parameters

NameType
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:263open in new window


log

log(...args_as_): void

Parameters

NameType
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:267open in new window


warn

warn(...args_as_): void

Parameters

NameType
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:271open in new window


error

error(...args_as_): void

Parameters

NameType
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:275open in new window


time_start

time_start(name_s_, ...args_as_): void

计时开始

Parameters

NameType
name_s_string
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:280open in new window


time_log

time_log(name_s_, ...args_as_): void

打印耗时

Parameters

NameType
name_s_string
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:297open in new window


time_end

time_end(name_s_, ...args_as_): void

总耗时

Parameters

NameType
name_s_string
...args_as_any[]

Returns

void

Defined in

assets/@framework/mk_logger.ts:316open in new window

📣 觉得很赞?分享给你的朋友吧!