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);
}
};

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

  1. js调试工具Console命令详解

    这篇文章主要介绍了js调试工具Console命令详解,需要的朋友可以参考下   一.显示信息的命令 复制代码 代码如下: < !DOCTYPE html> < html> &l ...

  2. 【F12】谷歌浏览器F12前端调试工具 Console

    谷歌浏览器F12前端调试工具 Console 前言 先上图:不知道有多少人发现,在浏览器开发工具的“Console”上的百度首页的关于百度招聘的信息: 今天要给大家介绍的就是是Web前端调试工具中的C ...

  3. js调试工具console详解

    #console基本输出方法,占位符:字符(%s).整数(%d).浮点数(%f)和对象(%o) console.log('日志'); console.info('信息'); console.error ...

  4. var a = {m:1}; var b = a; a.n = b ={n:1}; console.log(a);console.log(b);

    var a = {m:1}; var b = a; a.n = b ={n:1}; console.log(a); console.log(b); 确定b为{n:1},所以a为 {m:1,n:{n:1 ...

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

    一.显示信息的命令 <!DOCTYPE html> <html> <head> <title>常用console命令</title> < ...

  6. js调试工具console方法详解

    一.显示信息的方法 最常用的console.log(),一般用来调试. console.log('hello'); console.info('信息'); console.error('错误'); c ...

  7. console.log()、console.info()、console.debug()的区别

    onsole.log().console.info().console.debug()的作用都是在浏览器控制台打印信息的. 使用最多的是console.log().console.info()和con ...

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

    项目名称: spy-debugger 项目地址:https://github.com/wuchangming/spy-debugger 关于spy-debugger npm Build Status ...

  9. JS里try...catch...finally详解,以及console日志调试(console.log、console.info等)

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

随机推荐

  1. 深入理解Python中的yield和send

    send方法和next方法唯一的区别是在执行send方法会首先把上一次挂起的yield语句的返回值通过参数设定,从而实现与生成器方法的交互. 但是需要注意,在一个生成器对象没有执行next方法之前,由 ...

  2. Ubuntu 13.04 SSH其他机器连接慢的解决办法

    原来Windows上用Xshell,用这比较爽,命令open http,自动打开自己定义的http服务器SSH 远程连接,点一下文件传输,如果装了xsftp,自动启动xsftp,没有就来个提示,打开一 ...

  3. jQueryUI modal dialog does not show close button (x) JQueryUI和BootStrap混用时候,右上角关闭按钮显示不出图标的解决办法

    I had this problem and was able to resolve it with the declaration below. $.fn.bootstrapBtn = $.fn.b ...

  4. 关于CALayer 中的contents(图片) 拉伸

    最近做有关 发送图片的功能.微信显示的图片 使用气泡遮罩出来的..而且图片尺寸也不止一种. 既然UIImagView 可以拉伸图片,设置遮罩的CALayer 的content 可不可以. 关键CALa ...

  5. Android网络功能之会话发起协议SIP

    原文:http://android.eoe.cn/topic/android_sdk * 会话发起协议* Android提供了一个支持会话发起协议(SIP)的API,这可以让你添加基于SIP的网络电话 ...

  6. opencv之haar特征+AdaBoos分类器算法流程(三)

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/ ...

  7. 【转】JPA project Change Event Handler / 导致eclipse十分卡

    这是Eclipse中的一个GUG: Bug 386171 - JPA Java Change Event Handler (Waiting) 解决方法: 1.) 退出Myeclipse(或eclips ...

  8. SSO单点登录的发展由来以及实现原理

    单点登录以及权限,在很早之前都有写过,不过都比较简单,今天就具体说一下,以及下一步要做的 1.web单系统应用 早期我们开发web应用都是所有的包放在一起打成一个war包放入tomcat容器来运行的, ...

  9. webBrowser获取cookie

    private void BtnOpenUrl_Click(object sender, EventArgs e) { if (txtUrl.Text != "") { Myweb ...

  10. java.util.Date和java.sql.Date 一点区别

    最近无意中发现,在oracle中同一样的一个Date类型字段,存储的日期格式有两种不同的情况,第一种是2011-1-1 12:00:00,第二种是2011-1-1,仔细查找发现在向数据库中写数据的时候 ...