Socket
Book a DemoInstallSign in
Socket

@unpourtous/wt-console

Package Overview
Dependencies
Maintainers
14
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unpourtous/wt-console

React Native component for both Android and iOS

latest
npmnpm
Version
1.1.47
Version published
Weekly downloads
2
-50%
Maintainers
14
Weekly downloads
 
Created
Source

React Native应用内日志工具

JavaScript Style Guide

背景

App开发过程中,经常会遇到一个场景就是,测试说我遇到一个xxx问题,但是不能复现,之前比较多的解决方案是基于文件日志。我们自己使用过程中发现文件日志太重,而且测试同学取日志的学习成本太高。于是在web项目中开始使用类似vConsole这一类的工具,又因为我们主要使用到的日志查看和日志上传功能,所以当前的tianyan-react-native 版本只提供这两个核心功能。

特性

  • 通过简单的接入即可在App内查看日志。
  • 结合 tianyan-server 可以很方便的实现日志上传功能。

基本用法

TianYan嵌入到App最外层View中,具体用法可以参考exmaple目录

export default class SimpleApp extends Component {
  render () {
    return (
      <View style={styles.container}>
        {/* other view */}
        <TianYan options={{
          logServerUrl: 'http://23lab.com:3000/v1/log',
          maxLogLine: 1000,
          ignoreFilter: function () { // 根据自定义规则过滤日志避免手机端显示太多无用信息
            return (arguments && typeof arguments[0] === 'string' && arguments[0].indexOf('ignored log') === 0)
          }        
        }} />
      </View>
    )
  }
}

实现效果

1. 浮标为日志入口

image

2. 查看日志

image

3. 上传日志并且获取日志ID

image

4. 到日志管理端查看日志

image

Keywords

react-native

FAQs

Package last updated on 28 Nov 2019

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