@ezuikit/utils-logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Logger

日志工具类

scripts

# http://localhost:3000
pnpm run dev

pnpm run build

pnpm run test

使用

pnpm install @ezuikit/utils-logger
export interface LoggerOptions {
  level?: 'INFO' | 'LOG' | 'WARN' | 'ERROR';
  showTime?: boolean;
  name?: string;
}
import Logger from '@ezuikit/utils-logger'

const logger = new Logger({level: "INFO"})

logger.info("info")
logger.log("log")
logger.warn("warn")
logger.error("error")

// 更改日志等级 WARN 只打印 warn error
logger.setOptions({level: "WARN"})

logger.info("setOptions info")
logger.log("setOptions log")
logger.warn("setOptions warn")
logger.error("setOptions error")

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.1155latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.1155
1.0.1-alpha.12
1.0.1-alpha.00
1.0.0-alpha.36
1.0.0-alpha.20
1.0.0-alpha.10
1.0.0-alpha.00

Package Sidebar

Install

npm i @ezuikit/utils-logger

Weekly Downloads

163

Version

1.0.1

License

MIT

Unpacked Size

11.7 kB

Total Files

7

Last publish

Collaborators

  • ezviz-jzy
  • freeshine
  • ezviz-openteam