var system=require("../../system")
var settings=require("../../../config/settings");
const CtlBase = require("../ctl.base");
const uuidv4 = require('uuid/v4');
class OplogCtl extends CtlBase{
   constructor(){
     super(CtlBase.getServiceName(OplogCtl));
     //this.appS=system.getObject("service.appSve");
   }

   async initNewInstance(qobj){
     var u=uuidv4();
     var aid=u.replace(/\-/g,"");
     var rd={name:"",appid:aid}
     return system.getResult2(rd,null);
   }
   async debug(obj){
     obj.logLevel="debug";
     return this.create(null,obj);
   }
   async info(obj){
     obj.logLevel="info";
     return this.create(null,obj);
   }
   async warn(obj){
     obj.logLevel="warn";
     return this.create(null,obj);
   }
   async error(obj){
     obj.logLevel="error";
     return this.create(null,obj);
   }
   async fatal(obj){
     obj.logLevel="fatal";
     return this.create(null,obj);
   }
}
module.exports=OplogCtl;
