https://github.com/femessage/log-viewer
💻View terminal logs in browser
https://github.com/femessage/log-viewer
log-viewer
Last synced: 3 months ago
JSON representation
💻View terminal logs in browser
- Host: GitHub
- URL: https://github.com/femessage/log-viewer
- Owner: FEMessage
- License: mit
- Created: 2019-07-29T08:00:15.000Z (almost 7 years ago)
- Default Branch: dev
- Last Pushed: 2022-11-24T01:36:35.000Z (over 3 years ago)
- Last Synced: 2025-04-02T11:06:55.152Z (about 1 year ago)
- Topics: log-viewer
- Language: JavaScript
- Homepage: https://femessage.github.io/log-viewer
- Size: 2.09 MB
- Stars: 115
- Watchers: 2
- Forks: 22
- Open Issues: 6
-
Metadata Files:
- Readme: README-zh.md
- License: LICENSE
Awesome Lists containing this project
README
# log-viewer
[](https://travis-ci.com/FEMessage/log-viewer)
[](https://www.npmjs.com/package/@femessage/log-viewer)
[](https://www.npmjs.com/package/@femessage/log-viewer)
[](https://github.com/FEMessage/log-viewer/blob/master/LICENSE)
[](https://github.com/FEMessage/log-viewer/pulls)
[](https://github-tools.github.io/github-release-notes/)
日志查看组件,将终端日志内容展示在页面中

[English](./README-en.md)
## Table of Contents
- [Features](#features)
- [Install](#install)
- [Usage](#usage)
- [Links](#links)
- [Reference](#reference)
- [Performance](#performance)
- [内存占用](#内存占用)
- [item-mode](#item-mode)
- [vfor-mode](#vfor-mode)
- [render 耗时](#render-耗时)
- [item-mode](#item-mode-1)
- [vfor-mode](#vfor-mode-1)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [License](#license)
## Features
- 对日志流中特殊字符进行了处理
- 高性能,处理大量数据不卡顿
- 可自定义 loading 样式
- 可自动滚动到底部
[⬆ Back to Top](#table-of-contents)
## Install
```bash
yarn add @femessage/log-viewer
```
[⬆ Back to Top](#table-of-contents)
## Usage
```html
```
[⬆ Back to Top](#table-of-contents)
## Links
- [设计文档](https://www.yuque.com/docs/share/db3640ad-ab65-4588-8244-d245f90e9a6a#)
[⬆ Back to Top](#table-of-contents)
## Reference
- [thanks to react-lazylog](https://github.com/mozilla-frontend-infra/react-lazylog)
- [travis-ci logs](https://travis-ci.org/)
- [http://jafrog.com/2013/11/23/colors-in-terminal.html](http://jafrog.com/2013/11/23/colors-in-terminal.html)
- [https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)
[⬆ Back to Top](#table-of-contents)
## Performance
虚拟滚动使用的是:[https://github.com/tangbc/vue-virtual-scroll-list](https://github.com/tangbc/vue-virtual-scroll-list)
内部实现使用的 item-mode,因为比 vfor-mode 性能更好。
### 内存占用
使用 100,000 条数据进行测试
#### item-mode
组件渲染前页面内存:36.5MB
组件渲染后内存:48MB
内存消耗:11.5MB

#### vfor-mode
组件渲染前页面内存:43MB
组件渲染后内存:221MB
内存消耗:178MB

### render 耗时
使用 100,000 条数据进行测试
#### item-mode
render 时间:0.63ms
patch 时间: 72.18ms
总时间:72.85ms

#### vfor-mode
render 时间:933.05ms
patch 时间: 23.81ms
总时间:956.86ms

[⬆ Back to Top](#table-of-contents)
## Contributing
For those who are interested in contributing to this project, such as:
- report a bug
- request new feature
- fix a bug
- implement a new feature
Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/master/CONTRIBUTING.md).
[⬆ Back to Top](#table-of-contents)
## Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
[⬆ Back to Top](#table-of-contents)
## License
[MIT](./LICENSE)
[⬆ Back to Top](#table-of-contents)