Code Monkey home page Code Monkey logo

mini-vlog-report's Introduction


mini-vlog-report [小程序实时日志上报]


简体中文 | English

这是什么?

mini-vlog-report 是一个封装了 wx.getRealtimeLogManager 方法的小程序(微信)上报工具。将上报能力抽象封装起来,同时本地日志台打印出来。 同时优化了console的使用,将更醒目的配色配置到不同类型的日志输出上,并提供了可定制的样式能力。 上报只需要通过调用 .report() 方法即可实现。同时可以在微信小程序后台WeData查看上报内容。

ps:单条日志最大长度是3000字节

如何使用

装载

  • npm
npm install mini-vlog-report --save
  • pnpm
pnpm install mini-vlog-report --save

使用

import vLog from "mini-vlog-report";

vLog.log('拥有console的所有用法')
vLog.log('同console.log使用 不做上报')
vLog.info('同console.info使用 不做上报')
vLog.log('report start', '第一个参数在控制台会有颜色输出').report()
vLog.log('obj test ', {a: 1, b: 2, c: 3}).report()
vLog.info('info', 1234, 'abc', this).report()
vLog.warn('warn', 123, '警告').report()
vLog.error('error', '错误').report()
vLog.log(null)
vLog.log(undefined)
vLog.log(NaN)

效果




计划完善

  • [√] 单条日志超过3k字节的拆分成多个 批次提交
  • [√] 提供自定义日志类型能力
  • [] 非微信小程序场景下的日志上报(默认平台)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.