@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")

Package Sidebar

Install

npm i @ezuikit/utils-logger

Weekly Downloads

243

Version

1.0.1

License

MIT

Unpacked Size

11.7 kB

Total Files

7

Last publish

Collaborators

  • ezviz-jzy
  • freeshine
  • ezviz-openteam