Coder Social home page Coder Social logo

debug.js's Introduction

binnng

介绍下我自己。

安装

npm install binnng

使用方法

var binnng = require("binnng");

console.log(binnng.birthday); //1990.01.04

debug.js's People

Contributors

binnng avatar chinakids avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

debug.js's Issues

angular.module('app1', ["binnng/debug"]) 报错

define(['angular', 'domReady!', 'debug'], function(angular, doc, debug){
  debug.error('in app');
  // check angular(shim) and domReady
  var app = angular.module('app1', ["binnng/debug"])
    .controller('c1', ['$scope', function($scope){
      $scope.name = 'kaven';
      //$debug.error('error');
    }]);
  angular.bootstrap(doc.body, ['app1']);
});

debug.error('in app'); 任何情况下都正常输出信息。

angular.module('app1', ["binnng/debug"]) 报错,
去除依赖,改成 angular.module('app1', []) 不再报错。

错误信息如下:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.2/$injector/modulerr?p0=app1&p1=Error%3A%20…calhost%3A10000%2Fbower_components%2Fangularjs%2Fangular.min.js%3A19%3A339)

请问页面应该如何引入 debug.js,和 angular.js 引入的先后关系是什么样的?

感觉还不错哦。。。提几个优化方案

一个是 position:fixed 在iOS上有bug 。最好使用 position:absolute;

然后呢,能不能设置log最大显示条数,因为我发现log太多之后就看不到下方的log了。超出了多少条之后会删掉前面的比较好。

最后呢。能不能提供一个简单的方法开关 debug。 开发调试的时候使用debug很好用。但是当我要上线项目的时候该怎么办呢,总不能一条条的删除 debug.log("xxx") 吧.....

建议修改debug.js的参数和console的参数形式一致。

    for (fn in debugMap) {
      Debug.prototype[fn] = (function(fn) {
        return function() {
          var msg;
          if(arguments.length==1){
            msg=arguments[0];
          }else{
            msg=[].slice.apply(arguments);
          }
          this.fn = fn;
          this.msg = render(msg);
          this.color = debugMap[fn];
          return this.print();
        };
      })(fn);
    }

这样就可以使用debug.log(1,2,3,4);

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.