MatrixBerryCore
Log4jConfigurator.m
Go to the documentation of this file.
2  properties (Constant)
3  %
4  MASTER_LOG_FILE_NAME='master';
5  CHILD_LOG_FILE_NAME_PREFIX='child';
6  LOG_FILE_EXT=sprintf('log.%d-%02d-%02d-%02d-%02d-%02.0f',datevec(now));
7  MAIN_LOG_FILE_PREFIX='main.';
8  end
9  properties(Constant)
10  SP_MAIN_LOG_FILE_NAME='mxberry.testrunner.log4j.logfile.main.name'
11  SP_CUR_PROCESS_NAME='mxberry.testrunner.log4j.curProcessName'
12  SP_LOG_DIR_WITH_SEP='mxberry.testrunner.log4j.logfile.dirwithsep'
13  SP_LOG_FILE_EXP='mxberry.testrunner.log4j.logfile.ext'
14  CONF_REPO_MGR_CLASS=...
15  'mxberry.test.conf.AdaptiveConfRepoManager';
16  end
17  methods (Access=private)
18  function self=Log4jConfigurator()
19  end
20  end
21  methods (Static)
22  function configure(confSource,varargin)
23  self=mxberry.test.log.Log4jConfigurator();
24  if isa(confSource,self.CONF_REPO_MGR_CLASS)
25  if ~confSource.isParam('logging.log4jSettings')
26  mxberry.core.throwerror('wrongConfVersion',...
27  'Consider updating your configuration');
28  end
29  %
30  logPropStr=confSource.getParam(...
31  'logging.log4jSettings');
32  else
33  mxberry.core.throwerror('wrongInput',...
34  ['configuration source should be either ',...
35  'a property string or a reference',...
36  'to ',self.CONF_REPO_MGR_CLASS,' object']);
37  end
38  self.configureInternal(logPropStr,varargin{:});
39  end
40  function logFileName=getMainLogFileName()
41  self=mxberry.test.log.Log4jConfigurator();
42  logFileName=self.getMainLogFileNameInternal();
43  end
44  end
45 end
LOG4JCONFIGURATOR simplifies log4j configuration, especially when Parallel Computing Toolbox is used...
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
LOG4JCONFIGURATOR simplifies log4j configuration, especially when Parallel Computing Toolbox is used...