远程log调试工具console.re

http://console.re/

https://github.com/kurdin/console-remote

前文提到在手机微信上调试代码很痛苦,看不到日志。为了看到日志,得把日志发到服务器,再搞个东西看服务器上的日志。console.re 就是这么一个服务。

主要使用步骤如下:

  1. 在html文件中引入
    <script src="http://console.re/connector.js" data-channel="<your-channel-name>" id="consolerescript"></script>
  2. console.re.log(‘...‘);记录日志
  3. 打开 http://console.re/ 看日志

例子:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>logtest</title>
     <script src="http://console.re/connector.js" data-channel="trylog" id="consolerescript"></script>
</head>
<body>
<h1>See the log: <a href="http://console.re/trylog" target="_blank">http://console.re/trylog</a></h1>
<h1><a href="javascript:test()">click me to add log</a></h1>
<script>
    function test(){
        console.re.log(‘remote log test‘);
        return false;
    }
</script>
</body>
</html>


写了个wrapper。根据是否有console.re来调用log。方便调试。

window.log = function(){
  if(console.re){
     console.re.log.apply(console.re,arguments);
  }else{
    console.log.apply(console,arguments);
  }
};
时间: 2024-07-29 01:14:33

远程log调试工具console.re的相关文章

js调试工具Console命令详解

一.显示信息的命令 代码如下: <!DOCTYPE html> <html> <head> <title>常用console命令</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <script type="text/ja

js调试工具Console命令详解——转

一.显示信息的命令 <!DOCTYPE html> <html> <head> <title>常用console命令</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <script type="text/javascri

js调试工具console详解

#console基本输出方法,占位符:字符(%s).整数(%d).浮点数(%f)和对象(%o) console.log('日志'); console.info('信息'); console.error('错误'); console.warn('警告'); #console输出分组 console.group('组名'); console.groupEnd(); #对象属性.方法查询 console.dir('对象名称'); #显示某节点上的HTML/XML代码 console.dirxml('节

console.log(+‘2’) console.log(-‘2’) 输出什么?

+‘2’ 会将字符串‘2’转换为number类型2 -‘2’会将字符串‘2’转换为number类型1(自减); 所以 数字字符串之前存在数字中的正负号(+/-)时,会被转换成数字 console.log(typeof '3'); // string console.log(typeof +'3'); //number 同样,可以在数字前添加 '',将数字转为字符串 console.log(typeof 3); // number console.log(typeof (''+3)); //str

一站式远程页面调试工具spy-debugger 2.0,已支持HTTPS

项目名称: spy-debugger 项目地址:https://github.com/wuchangming/spy-debugger 关于spy-debugger npm Build Status 1.一站式页面调试工具,远程调试任何手机浏览器页面,任何手机移动端webview(如:微信,HybirdApp等)HTTP/HTTPS. 2.spy-debugger内部集成了weinre. 3.支持HTTPS页面的调试. 安装 Windows 下 npm install spy-debugger

js中console.log()和console.dir()的区别

console.log(),会在浏览器控制台打印信息 console.dir()可以显示一个对象的所有属性和方法(详细打印,利于分析对象) 原文地址:https://www.cnblogs.com/l-millie/p/10145075.html

console.log()与console.dir()

console.log()可以取代alert()或document.write(),在网页脚本中使用console.log()时,会在浏览器控制台打印出信息. console.dir()可以显示一个对象所有的属性和方法. 代码格式: 之前想打印输出,ul的相关属性 控制台输出结果: 现在可以利用console.dir直接获取相关属性 控制台输出打印结果 . 原文地址:https://www.cnblogs.com/jianxian/p/10667125.html

触动精灵远程Log模块

一.功能 lua log方法能够自动发现同一网段下面的log服务器 lua log方法能够主动将log发给服务器 lua 客户端进程重启服务端不存在影响 二.实现 服务器使用python编写: 启动一个线程,用UDP监听特定端口,接受客户端的扫描,反馈日志的端口 启动一个线程,监听特定端口,接受TCP连接,分派新的日志线程处理log 客户端使用lua 编写: 打印log之前使用UDP套节字扫描服务器的日志端口,然后创建TCP套节字发送日志 三.源代码: 服务器: import socket im

调试工具--console用法收藏

1.使用console进行性能测试和计算代码运行时间:http://www.cnblogs.com/0603ljx/p/4387628.html 2.console命令详解:http://www.cnblogs.com/see7di/archive/2011/11/21/2257442.html 3.利用console来进行调试:http://www.cnblogs.com/leejersey/archive/2012/11/27/2790998.html 4.js高级调试:        ht