"use strict";var path=require("path");var log4js=require("log4js");var jsUtil=require("./jsUtil");var logDir=path.resolve(jsUtil.isNodeWebkit()?jsUtil.getDataPath():jsUtil.getWorkPath(),"logs");jsUtil.ensurePathFile(logDir);log4js.configure({appenders:[{type:"console",layout:{type:"messagePassThrough"}},{type:"dateFile",filename:path.resolve(logDir,"log"),pattern:"-yyyy-MM-dd.log",maxLogSize:1024,alwaysIncludePattern:true,backups:4,daysToKeep:20}],replaceConsole:true});log4js.setGlobalLogLevel(log4js.levels.DEBUG);exports.setLogLevel=function(e){log4js.setGlobalLogLevel(e||log4js.levels.DEBUG)};exports.getLogger=function(e){return log4js.getLogger(e||"dateFileLog")};