Giter Club home page Giter Club logo

debug's Introduction

debug.js

在手机上打印调试信息。


##快速上手

debug = require('debug');

//debug.js为了方便调试,会默认开启捕捉浏览器的报错。如果你不需要这个功能,可以这样禁止它:
debug.guai()


//API
debug.success("This is success message:)");
debug.error("This is error message:)");
debug.log("This is primary message:)");
debug.log({a: 1, b: 2});
debug.log([1,2,3]);

##DEMO

http://binnng.github.io/debug.js/demo/index.html

##console.log

当然,如果你想继续使用console.log,可以这么封装:

if('ontouchend' in window) {
  console.log = debug.log.bind(debug);
}

之后上线时,可以使用uglify压缩掉所有console的代码。完美~

debug's People

Contributors

303182519 avatar

Watchers

James Cloos avatar MrFanggesun avatar lirunzi avatar April avatar  avatar plcc avatar 浴火小青春 avatar  avatar  avatar guoshengze avatar

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.