cs5117155
V2EX  ›  微信

微信小程序有什么工具可以把 js 打印输送到服务端日志

  •  
  •   cs5117155 · Aug 21, 2024 · 1643 views
    This topic created in 662 days ago, the information mentioned may be changed or developed.

    因为有时候用户使用物联网设备的时候,总会出现一些奇奇怪怪问题。 我想把小程序打印的console.log一起发送服务端,这样我可以结合前后端一起分析问题。 请问目前有什么开源工具支持

    5 replies    2024-08-21 11:09:17 +08:00
    duanxianze
        1
    duanxianze  
       Aug 21, 2024
    你这不就是埋点和日志吗?微信官方就有相关的功能
    bestie
        2
    bestie  
       Aug 21, 2024
    微信小程序自带日志上报,到小程序后台看一下就知道了
    cs5117155
        3
    cs5117155  
    OP
       Aug 21, 2024
    我看了一下 https://developers.weixin.qq.com/miniprogram/dev/framework/realtimelog/,他这个必须登录微信 We 端查看,有无说可以直接传送到服务器,不需要在微信小程序管理端登录查看的
    @duanxianze
    duanxianze
        4
    duanxianze  
       Aug 21, 2024
    那也简单 你只要判断是正式环境,就执行代码拦截 console.log ,里面自己请求写上传就行了
    @cs5117155
    cs5117155
        5
    cs5117155  
    OP
       Aug 21, 2024
    @duanxianze 有那么简单吗,我看它文档好像还要额外再配置一堆东西,我在研究研究下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:07 · PVG 07:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.