code: function ensureDir(filename) {
      var fs = require('fs');
      var path = require('path');
      var dir = path.dirname(filename);
      if (!fs.existsSync(dir)) {
          var mkdirp = require('mkdirp').sync;
          mkdirp(dir);
      }
  }
docs: 确保日志所在的文件夹存在
  
  @inner
  @param {string} filename 日志文件