Revision: 7097
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7097&view=rev
Author:   dnaber
Date:     2012-05-28 20:04:12 +0000 (Mon, 28 May 2012)
Log Message:
-----------
more logging

Modified Paths:
--------------
    
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleEditorController.groovy

Modified: 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleEditorController.groovy
===================================================================
--- 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleEditorController.groovy
       2012-05-28 17:49:58 UTC (rev 7096)
+++ 
trunk/ltcommunity/grails-app/controllers/org/languagetool/RuleEditorController.groovy
       2012-05-28 20:04:12 UTC (rev 7097)
@@ -41,15 +41,20 @@
         List expectedRuleMatches = langTool.check(params.incorrectExample1)
         List unexpectedRuleMatches = langTool.check(params.correctExample1)
         List problems = []
+        List shortProblems = []
         if (expectedRuleMatches.size() == 0) {
             problems.add("The rule did not find an error in the given example 
sentence with an error")
+            shortProblems.add("errorNotFound")
         }
         if (unexpectedRuleMatches.size() > 0) {
             problems.add("The rule found an error in the given example 
sentence that is not supposed to contain an error")
+            shortProblems.add("unexpectedErrorFound")
         }
         if (problems.size() == 0) {
+            log.info("Checked rule: valid - LANG: ${language.getShortName()} - 
PATTERN: ${params.pattern} - BAD: ${params.incorrectExample1} - GOOD: 
${params.correctExample1}")
             [messagePreset: params.messageBackup, namePreset: 
params.nameBackup]
         } else {
+            log.info("Checked rule: invalid - LANG: ${language.getShortName()} 
- PATTERN: ${params.pattern} - BAD: ${params.incorrectExample1} - GOOD: 
${params.correctExample1} - ${shortProblems}")
             render(template: 'checkRuleProblem', model: [problems: problems, 
hasRegex: hasRegex(patternRule)])
         }
     }
@@ -86,8 +91,10 @@
 
     def createXml = {
         if (!params.message || params.message.trim().isEmpty()) {
+            log.info("Create rule XML: missing message parameter")
             [error: "Please fill out the 'Error Message' field"]
         } else {
+            log.info("Create rule XML: okay")
             String message = getMessage()
             String correctSentence = params.correctExample1.encodeAsHTML()
             Language language = getLanguage()

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to