1.1.6 • Published 2 years ago

vydo v1.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Tini Debug

Install

Use npm

npm install @tiki.vn/tini-debug --save

Use yarn

yarn add @tiki.vn/tini-debug

How to use

In file app.js or app.ts

...
import logger from '@tiki.vn/tini-debug';
...

logger.init(config);

config:

{
  "isOverwriteLog": "true", // Ghi đè my.debug.log(), my.debug.warn(), my.debug.error()
  "isOverwriteRequest": "true", // Ghi đè my.request()
  "isApplyConsoleLog": "true", // Cho phép console.log() khi overwrite lại my.debug
  "config": { 
    "whitelist": ["*"], // whitelist email ["*"]: tất cả email, ["@tiki.vn"]: email có domain @tiki.vn, ["abc@tiki.vn"]: kiểm tra email
    "isSendToSlack": "false", // Gửi thông báo qua Slack channel khi dùng log error
    "slackUrl": SLACK_URL, // Link bot gửi thông báo ở trong channel Slack
    "appName": "APP_NAME", // Tên app 
  },
}

Register the component into .json config file

{
  "usingComponents": {
    "logger": "@tiki.vn/tini-debug/lib/components/global-logger/index"
  }
}

Then you can use it as normal component:

<logger env="prod" type="circle"/>

Props của component bao gồm:

Thuộc tínhKiểu dữ liệuGiá trị mặc địnhMô tả
env'prod', 'dev''dev'Nếu env = 'prod sẽ kiểm tra whitelist đã được config từ trước
type'default', 'circle', 'shake''default'Kiểu hiển thị component, mặc định không hiển thị
zIndexnumber2
userEmailstringEmail để kiểm tra whitelist, nếu không có sẽ kiểm tra bằng token
1.1.6

2 years ago

1.1.5

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago