npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wxa/log

v2.5.1

Published

集合小程序实时日志上报以及普通console

Downloads

3

Readme

wxa-log

结合微信的实时日志,在上报微信实时日志的同时 avatar 也能在控制台输出console打印信息 avatar 如果用户反馈了相关问题,在微信管理台下载的日志,除去原有的调用流程,使用wxa-log上报的日志也会一并出现在日志中 avatar 注意:开发者工具中目前不会上报日志,请用真机操作之后,在管理台-开发-运维中心-实时日志中查看

安装

npm install -S @wxa/log

使用方法

1、wxa目前只能在页面(page)、组件(component)中注入全局方法。在项目的app.js中使用如下代码全局引用:

import logPlugin from '@wxa/log';
wxa.use(logPlugin);

@App
class Main {
    ...
}

2、在页面或者组件的具体位置打印日志: 推荐如下格式日志上传:

// 该格式日志将会针对文本中身份证、手机号码、邮箱信息进行校验并给开发者提示,但依旧会上传日志
this.$log.info('这是什么日志');
// 该格式日志将会针对第一个参数进行身份证、手机号码、邮箱信息校验并给开发者提示,后续参数中的敏感信息将会做掩码处理,但依旧会上传日志
this.$log.info('页面唤起时间: ', data);
this.$log.warn('warn');
this.$log.error('error');
this.$log.setFilterMsg('filterkeyword');
this.$log.setFilterMsg('addfilterkeyword');

注意:使用前请仔细阅读官方文档,实时日志上报适用于关键流程,一条日志的上限是5KB,避免在循环里面调用打日志接口,所以仅需要改造现有项目关键流程日志上报逻辑即可

在js文件中上报实时日志

1、在文件顶部引入插件:

import {$log} from '@wxa/log';

2、在文件具体位置打印日志:

// 该格式日志将会针对文本中身份证、手机号码、邮箱信息进行校验并给开发者提示,但依旧会上传日志
$log.info('这是什么日志');
// 该格式日志将会针对第一个参数进行身份证、手机号码、邮箱信息校验并给开发者提示,后续参数中的敏感信息将会做掩码处理,但依旧会上传日志
$log.info('页面唤起时间: ', data);
$log.error('error');
$log.setFilterMsg('filterkeyword');
$log.setFilterMsg('addfilterkeyword');