zoukankan      html  css  js  c++  java
  • node debug包

    'use strict';
    
    var debug = require('debug')('http')
      , http = require('http')
      , name = 'My App';
    
    // fake app
    
    debug('booting %s', name);
    
    http.createServer(function(req, res){
      debug(req.method + ' ' + req.url);
      res.end('hello
    ');
    }).listen(3000, function(){
      debug('listening');
    });

    代码如上,在命令台输入一下命令可看到打印信息

    set DEBUG=http & node app.js http> debug.log

    如果是这种方式定义debug名字(mydebug:http mydebug:work)时可以这样输入
    set DEBUG=http: * & node app.js http> debug.log(代表调试所有mydebug:开头的)

  • 相关阅读:
    ojdbc14.jar
    Redis
    ftl转成word
    Swagger
    SpringBoot
    条件注解
    Spring SpringMVC MyBatis
    Spring介绍
    Django_mysql表查询
    Django01
  • 原文地址:https://www.cnblogs.com/ytu2010dt/p/5439760.html
Copyright © 2011-2022 走看看