🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

fly-cat-console

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fly-cat-console

可以考虑改成 log.success() log.json({ a: 1231213, b: { c: 123 } }, '请求结果.......') log.img() log() 这种形式,考虑结合webpack 转义为对应的类型

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
-90.91%
Maintainers
1
Weekly downloads
 
Created
Source

可以考虑改成 log.success() log.json({ a: 1231213, b: { c: 123 } }, '请求结果.......') log.img() log() 这种形式,考虑结合webpack 转义为对应的类型

所以还需要去研究一下 webpack 看如何去实现这个功能,可以参考大牛实现 try{}catch{} 封装捕获 async 和 await 的实现方式

如果webpack 实现较为困难,则将这种较为简陋的方式封装成 npm 包 发布到 github 上

使用方式类似于 import Log from 'easy-log' window.log = new Log({ success: 'green', warning: 'orange', danger: 'red', primary: 'blue' })

最重要的一点是不能破坏 浏览器自行的 log 打印时候的 文件以及代码行数的信息

通过不同的方式实现 浏览器和小黑板控制器的彩色打印功能 就像axios 一样,分别兼容不同的容器环境

Keywords

console

FAQs

Package last updated on 25 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts