// var log4js = require('log4js');
var settings = require("../../config/settings");
const uuidv4 = require('uuid/v4');
const system = require("../system");
class LogClient {
  constructor() {
    // log4js.configure(settings.basepath+"/app/config/log4js.json");
    // this.logerApp=log4js.getLogger("app");
    // this.logerHttp=log4js.getLogger("http");
  }
  getUUID() {
    var uuid = uuidv4();
    var u = uuid.replace(/\-/g, "");
    return u;
  }
  async log(pobj, req, rtn) {
    rtn.requestId = this.getUUID()
    req.params.param = pobj
    //第三个字段应该存公司id
    system.execLogs(req.xctx.codetitle, req.params, pobj.company_id, rtn, null).then(res => {
      if (res && res.status == 1) {
        console.log("log.....success")
      } else {
        console.log("log.....fail")
      }
    }).catch(e => {
      console.log("log.....fail")
    })
  }
}
module.exports = LogClient;
