Skip to content

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

@as3long

Description

@as3long
    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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions