コード例 #1
0
 static void Settings_QueryPerformed(DatabaseBase database, string pSql, int records, QueryType pQueryType,
                                     DateTime?pStart, DateTime?pEnd, Exception pException, IsolationLevel pIsolationLevel, int?pResultSize, ulong?transactionId)
 {
     if (pException == null)
     {
         LOG.Debug("End:start:{0:MM-dd-yy HH:mm:ss.fff}, end:{1:MM-dd-yy HH:mm:ss.fff}, rows affected:{2}", pStart, pEnd, records);
     }
     else
     {
         LOG.Error(string.Format("End:start:{0:MM-dd-yy HH:mm:ss.fff}, end:{1:MM-dd-yy HH:mm:ss.fff}, ERROR:{2}", pStart, pEnd, pException.Message), pException);
     }
 }
コード例 #2
0
        public void Load(String templateName)
        {
            var templateDir = Path.Combine(TEMPLATE_FOLDER, templateName);

            if (!Directory.Exists(templateDir))
            {
                throw new TemplateConfigException("Template directory not found.");
            }
            var configFile = Path.Combine(templateDir, TEMPLATE_CONFIG_FILE);

            if (!File.Exists(configFile))
            {
                throw new TemplateConfigException("Template config file not found.");
            }
            TemplateConfigs = new List <TemplateConfig>();
            var lines = File.ReadAllLines(configFile);

            LoadProperties(lines);
            LoadTemplates(templateDir, lines);
            LOG.Debug("Load config for template: {0}, templates: {1}", templateName, TemplateConfigs.Count);
        }