Changeset 725


Ignore:
Timestamp:
08/31/12 10:27:50 (12 years ago)
Author:
pharms
Message:
  • use console for logging instead of logger
Location:
trunk
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/manager/TaskTreeManagerTest.java

    r692 r725  
    11package de.ugoe.cs.quest.tasktrees.manager; 
    22 
    3 import java.util.logging.Logger; 
     3import java.util.logging.Level; 
    44 
    55import org.junit.After; 
     
    1010import de.ugoe.cs.quest.eventcore.IEventTarget; 
    1111import de.ugoe.cs.quest.eventcore.IEventType; 
    12 import de.ugoe.cs.quest.tasktrees.testutils.SimpleLogFormatter; 
    1312import de.ugoe.cs.quest.tasktrees.testutils.TaskTreeChecker; 
    1413import de.ugoe.cs.quest.test.DummyGUIElement; 
    1514import de.ugoe.cs.quest.test.DummyInteraction; 
     15import de.ugoe.cs.util.console.TextConsole; 
    1616 
    1717/** 
     
    3131    @Before 
    3232    public void setUp() { 
    33         Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter()); 
    34  
     33        new TextConsole(Level.FINEST); 
    3534        manager = new TaskTreeManager(); 
    3635    } 
  • trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java

    r655 r725  
    33import java.util.ArrayList; 
    44import java.util.List; 
    5 import java.util.logging.Logger; 
     5import java.util.logging.Level; 
    66 
    77import org.junit.Before; 
     
    1010import de.ugoe.cs.quest.eventcore.IEventType; 
    1111import de.ugoe.cs.quest.tasktrees.nodeequality.NodeEqualityRuleManager; 
    12 import de.ugoe.cs.quest.tasktrees.testutils.SimpleLogFormatter; 
    1312import de.ugoe.cs.quest.tasktrees.testutils.Utilities; 
    1413import de.ugoe.cs.quest.tasktrees.treeifc.IEventTask; 
     
    1918import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeBuilder; 
    2019import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory; 
     20import de.ugoe.cs.util.console.TextConsole; 
    2121 
    2222/** 
     
    4646    @Before 
    4747    public void setUp() { 
    48         Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter()); 
     48        new TextConsole(Level.FINEST); 
    4949        events = new ArrayList<IEventTask>(); 
    5050    } 
  • trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/manager/TaskTreeManager.java

    r710 r725  
    11package de.ugoe.cs.quest.tasktrees.manager; 
    22 
    3 import java.util.logging.Logger; 
     3import java.util.logging.Level; 
    44 
    55import de.ugoe.cs.quest.eventcore.Event; 
     
    1111import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode; 
    1212import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory; 
     13import de.ugoe.cs.util.console.Console; 
    1314 
    1415/** 
     
    2223    /** */ 
    2324    private static final int MAX_EVENTS_TILL_RULE_APPLICATION = 100; 
    24  
    25     /** */ 
    26     private static Logger LOG = Logger.getLogger(TaskTreeManager.class.getName()); 
    2725 
    2826    /** */ 
     
    5149     */ 
    5250    public void handleNewEvent(Event event) { 
    53         addEventTask(taskTreeNodeFactory.createNewEventTask(event.getType(), event.getTarget())); 
     51        handleEventTask(taskTreeNodeFactory.createNewEventTask(event.getType(), event.getTarget())); 
    5452    } 
    5553 
     
    5856     */ 
    5957    public synchronized ITaskTree getTaskTree() { 
    60         LOG.info("applying rules temporal relationship generation rules"); 
     58        Console.traceln(Level.INFO, "applying temporal relationship generation rules"); 
    6159 
    6260        ISequence currentRootSequence = rootSequence.clone(); 
     
    6866 
    6967    /** 
    70      * @param task 
    71      */ 
    72     private synchronized void addEventTask(IEventTask task) { 
    73         handleEventTask(task); 
    74     } 
    75  
    76     /** 
    7768     * adds the task to the current or the new sequence. The decision depends on the type of task. 
    7869     * If the task finishes the current sequence, the sequence is marked as finished If the task 
     
    8071     * finished. Otherwise it is added to a new sequence. 
    8172     */ 
    82     private void handleEventTask(IEventTask eventTask) { 
     73    private synchronized void handleEventTask(IEventTask eventTask) { 
    8374        if (!(eventTask.getEventType() instanceof KeyboardFocusChange)) { 
    84             LOG.info("handling interaction event task \"" + eventTask + "\""); 
     75            Console.traceln(Level.INFO, "handling interaction event task \"" + eventTask + "\""); 
    8576            addTaskToSequence(eventTask); 
    8677        } 
     
    9788            eventsTillRuleApplication = MAX_EVENTS_TILL_RULE_APPLICATION; 
    9889 
    99             LOG.info("applying rules temporal relationship generation rules"); 
     90            Console.traceln(Level.INFO, "applying temporal relationship generation rules"); 
    10091            ComponentManager.getTemporalRelationshipRuleManager().applyRules(rootSequence, 
    10192                                                                             taskTreeBuilder, 
  • trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityRuleManager.java

    r655 r725  
    2020 */ 
    2121public class NodeEqualityRuleManager { 
    22  
    23     /** */ 
    24     // private static Logger LOG = Logger.getLogger(NodeEqualityRuleManager.class.getName()); 
    2522 
    2623    /** */ 
  • trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/temporalrelation/TemporalRelationshipRuleManager.java

    r721 r725  
    33import java.util.ArrayList; 
    44import java.util.List; 
    5 import java.util.logging.Logger; 
     5import java.util.logging.Level; 
    66 
    77import de.ugoe.cs.quest.tasktrees.nodeequality.NodeEqualityRuleManager; 
     
    99import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode; 
    1010import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory; 
     11import de.ugoe.cs.util.console.Console; 
    1112 
    1213/** 
     
    1819public class TemporalRelationshipRuleManager { 
    1920     
    20     /** */ 
    21     private static Logger LOG = Logger.getLogger(TemporalRelationshipRuleManager.class.getName()); 
    22  
    2321    /** */ 
    2422    private NodeEqualityRuleManager nodeEqualityRuleManager; 
     
    4139     */ 
    4240    public void init() { 
    43         LOG.info("initializing"); 
    44  
    4541        ruleIndex.add(new DefaultEventTargetSequenceDetectionRule()); 
    4642        ruleIndex.add(new TrackBarSelectionDetectionRule(nodeEqualityRuleManager)); 
     
    7975                           String               logIndent) 
    8076    { 
    81         LOG.info(logIndent + "applying rules for " + parent); 
     77        Console.traceln(Level.FINER, logIndent + "applying rules for " + parent); 
    8278 
    8379        int noOfRuleApplications = 0; 
     
    9389                     RuleApplicationStatus.RULE_APPLICATION_FINISHED)) 
    9490                { 
    95                     LOG.info(logIndent + "applied rule " + rule + " on " + parent); 
     91                    Console.traceln 
     92                        (Level.FINE, logIndent + "applied rule " + rule + " on " + parent); 
    9693                    noOfRuleApplications++; 
    9794 
     
    117114 
    118115        if (noOfRuleApplications <= 0) { 
    119             LOG.warning(logIndent + "no rules applied --> no temporal relationship generated"); 
     116            Console.traceln(Level.INFO, logIndent + "no rules applied --> no temporal " + 
     117                            "relationship generated"); 
    120118        } 
    121119 
  • trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability/AbstractUsabilityEvaluationTC.java

    r698 r725  
    55 
    66import java.util.ArrayList; 
    7 import java.util.logging.Logger; 
     7import java.util.logging.Level; 
    88import java.util.regex.Matcher; 
    99import java.util.regex.Pattern; 
     
    1313import de.ugoe.cs.quest.eventcore.Event; 
    1414import de.ugoe.cs.quest.eventcore.gui.TextInput; 
    15 import de.ugoe.cs.quest.tasktrees.testutils.SimpleLogFormatter; 
    1615import de.ugoe.cs.quest.tasktrees.treeifc.IEventTask; 
    1716import de.ugoe.cs.quest.tasktrees.treeifc.IIteration; 
     
    2726import de.ugoe.cs.quest.test.DummyInteraction; 
    2827import de.ugoe.cs.quest.test.DummyTextField; 
     28import de.ugoe.cs.util.console.TextConsole; 
    2929 
    3030/** 
     
    4747    @Before 
    4848    public void setUp() { 
    49         Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter()); 
     49        new TextConsole(Level.FINEST); 
    5050    } 
    5151 
  • trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityEvaluationManager.java

    r655 r725  
    33import java.util.ArrayList; 
    44import java.util.List; 
    5 import java.util.logging.Logger; 
     5import java.util.logging.Level; 
    66 
    77import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTree; 
     8import de.ugoe.cs.util.console.Console; 
    89 
    910/** 
     
    1516public class UsabilityEvaluationManager { 
    1617     
    17     /** */ 
    18     private static Logger LOG = Logger.getLogger(UsabilityEvaluationManager.class.getName()); 
    19  
    2018    /** */ 
    2119    private List<UsabilityEvaluationRule> rules = new ArrayList<UsabilityEvaluationRule>(); 
     
    4442     */ 
    4543    public UsabilityEvaluationResult evaluateUsability(ITaskTree taskTree) { 
    46         LOG.info("evaluating usability of task tree " + taskTree); 
     44        Console.traceln(Level.INFO, "evaluating usability of task tree " + taskTree); 
    4745 
    4846        List<UsabilityEvaluationResult> results = new ArrayList<UsabilityEvaluationResult>(); 
    4947 
    5048        for (UsabilityEvaluationRule rule : rules) { 
    51             LOG.info("applying rule " + rule.getClass().getSimpleName()); 
     49            Console.traceln(Level.INFO, "applying rule " + rule.getClass().getSimpleName()); 
    5250            UsabilityEvaluationResult result = rule.evaluate(taskTree); 
    5351            results.add(result); 
    54             LOG.info("the rule found " + result.getAllDefects().size() + " usability defects, of " + 
    55                      "which " + result.getSevereDefects().size() + " are severe."); 
     52            Console.traceln(Level.INFO, "the rule found " + result.getAllDefects().size() + 
     53                            " usability defects, of which " + result.getSevereDefects().size() + 
     54                            " are severe."); 
    5655        } 
    5756 
    5857        UsabilityEvaluationResult result = mergeResults(results); 
    59         LOG.info("the evaluation result contains " + result.getAllDefects().size() + 
    60                  " defects, of which " + result.getSevereDefects().size() + " are severe."); 
     58        Console.println("the evaluation result contains " + result.getAllDefects().size() + 
     59                        " defects, of which " + result.getSevereDefects().size() + " are severe."); 
    6160        return result; 
    6261    } 
  • trunk/quest-misc-test/src/test/java/de/ugoe/cs/tasktree/keyboardmaps/KeyboardMapTest.java

    r655 r725  
    44 
    55import java.util.Locale; 
     6import java.util.logging.Level; 
    67 
    78import org.junit.Before; 
    89import org.junit.Test; 
     10 
     11import de.ugoe.cs.util.console.TextConsole; 
    912 
    1013/** 
     
    2124    @Before 
    2225    public void setUp() { 
    23         // Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter()); 
     26        new TextConsole(Level.FINEST); 
    2427    } 
    2528 
  • trunk/quest-misc/src/main/java/de/ugoe/cs/tasktree/keyboardmaps/KeyboardMap.java

    r655 r725  
    1212import java.util.Map; 
    1313import java.util.logging.Level; 
    14 import java.util.logging.Logger; 
     14 
     15import de.ugoe.cs.util.console.Console; 
    1516 
    1617/** 
     
    2122 */ 
    2223public class KeyboardMap { 
    23  
    24     /** */ 
    25     private static Logger LOG = Logger.getLogger(KeyboardMap.class.getName()); 
    2624 
    2725    /** */ 
     
    110108     */ 
    111109    void init() throws IllegalArgumentException { 
    112         LOG.info("initializing keymap for locale " + locale); 
     110        Console.traceln(Level.FINE, "initializing keymap for locale " + locale); 
    113111 
    114112        List<String[]> deadKeySequences = new ArrayList<String[]>(); 
     
    116114        readStream(getStream(fileName), deadKeySequences, keyStrokes); 
    117115 
    118         LOG.info("read " + keyStrokes.size() + " key strokes and " + deadKeySequences.size() + 
    119                  " dead key sequences"); 
     116        Console.traceln(Level.FINER, "read " + keyStrokes.size() + " key strokes and " + 
     117                        deadKeySequences.size() + " dead key sequences"); 
    120118 
    121119        VirtualKeySynonyms virtualKeySynonyms = determineVirtualKeySynonyms(keyStrokes); 
     
    135133     */ 
    136134    private InputStream getStream(String name) { 
    137         LOG.info("reading keymap for locale " + locale + " from resource keymaps/" + name); 
     135        Console.traceln 
     136          (Level.FINER, "reading keymap for locale " + locale + " from resource keymaps/" + name); 
    138137 
    139138        InputStream stream = 
     
    164163        } 
    165164        catch (UnsupportedEncodingException e) { 
    166             LOG.log(Level.WARNING, "no keyboard map available for locale " + locale, e); 
     165            Console.traceln(Level.WARNING, "no keyboard map available for locale " + locale); 
    167166            throw new IllegalArgumentException 
    168167                ("provided stream can not be read due to invalid encoding", e); 
     
    178177        } 
    179178        catch (IOException e) { 
    180             LOG.log(Level.WARNING, "no keyboard map available for locale " + locale, e); 
     179            Console.traceln(Level.WARNING, "no keyboard map available for locale " + locale); 
    181180            throw new IllegalArgumentException("no keyboard map available for locale " + locale, e); 
    182181        } 
     
    186185            } 
    187186            catch (IOException e) { 
    188                 LOG.warning("could not close input stream for reading keyboard map"); 
     187                Console.traceln 
     188                    (Level.WARNING, "could not close input stream for reading keyboard map"); 
    189189            } 
    190190        } 
     
    235235            for (int i = 0; i < keyStrokes.size(); i++) { 
    236236                if (keyStrokes.get(i)[0].equals(values[0])) { 
    237                     LOG.finest("replacing key stroke " + values[0] + " with former keyid " + 
    238                                keyStrokes.get(i)[1] + " with new key id " + values[1]); 
     237                    Console.traceln(Level.FINEST, "replacing key stroke " + values[0] + 
     238                                    " with former keyid " + keyStrokes.get(i)[1] + 
     239                                    " with new key id " + values[1]); 
    239240                    keyStrokes.set(i, values); 
    240241                    alreadyAdded = true; 
     
    256257     */ 
    257258    private VirtualKeySynonyms determineVirtualKeySynonyms(List<String[]> keyStrokes) { 
    258         LOG.info("determining virtual keys and synonyms for the keymap"); 
     259        Console.traceln(Level.FINER, "determining virtual keys and synonyms for the keymap"); 
    259260 
    260261        VirtualKeySynonyms virtualKeySynonyms = new VirtualKeySynonyms(); 
     
    280281        for (String[] unmatchedKeyStroke : unmatchedKeyStrokes) { 
    281282            if (!virtualKeySynonyms.containsKey(getKeyId(unmatchedKeyStroke[1]))) { 
    282                 LOG.finest("no virtual key mapped to key stroke " + unmatchedKeyStroke[0] + "(" + 
    283                            unmatchedKeyStroke[1] + ") of keyboard map for locale " + locale); 
     283                Console.traceln(Level.FINEST, "no virtual key mapped to key stroke " + 
     284                                unmatchedKeyStroke[0] + "(" + unmatchedKeyStroke[1] + 
     285                                ") of keyboard map for locale " + locale); 
    284286            } 
    285287        } 
     
    360362                } 
    361363                else { 
    362                     LOG.severe("unknown condition " + values[i] + " specified for key stroke " + 
    363                                keyStrokeName + " through keyboard map for locale " + locale); 
     364                    Console.traceln(Level.SEVERE, "unknown condition " + values[i] + 
     365                                    " specified for key stroke " + keyStrokeName + 
     366                                    " through keyboard map for locale " + locale); 
    364367                    throw new IllegalArgumentException 
    365368                        ("no keyboard map available for locale " + locale); 
     
    400403 
    401404        if (virtualKeys == null) { 
    402             LOG.severe("no virtual key mapped to key stroke " + keyStrokeName + 
    403                        " of keyboard map for locale " + locale); 
     405            Console.traceln(Level.SEVERE, "no virtual key mapped to key stroke " + keyStrokeName + 
     406                            " of keyboard map for locale " + locale); 
    404407            // throw new IllegalArgumentException("no keyboard map available for locale " + 
    405408            // mLocale); 
     
    10171020        } 
    10181021        else { 
    1019             LOG.finest("unknown virtual key for key stroke " + keyStrokeName + 
    1020                        " specified through " + "keyboard map for locale " + locale); 
     1022            Console.traceln(Level.FINEST, "unknown virtual key for key stroke " + keyStrokeName + 
     1023                            " specified through " + "keyboard map for locale " + locale); 
    10211024 
    10221025            return null; 
     
    20152018        } 
    20162019        else { 
    2017             LOG.severe("unknown key stroke name " + keyStrokeName + 
    2018                        " specified through keyboard map " + "for locale " + locale); 
     2020            Console.traceln(Level.SEVERE, "unknown key stroke name " + keyStrokeName + 
     2021                            " specified through keyboard map " + "for locale " + locale); 
    20192022 
    20202023            // if (shift) 
  • trunk/quest-misc/src/main/java/de/ugoe/cs/tasktree/keyboardmaps/VirtualKeySynonyms.java

    r655 r725  
    55import java.util.List; 
    66import java.util.Map; 
    7 import java.util.logging.Logger; 
     7import java.util.logging.Level; 
     8 
     9import de.ugoe.cs.util.console.Console; 
    810 
    911/** 
     
    1517class VirtualKeySynonyms { 
    1618     
    17     /** */ 
    18     private static Logger LOG = Logger.getLogger(KeyboardMap.class.getName()); 
    19  
    2019    /** */ 
    2120    private Map<Integer, List<VirtualKey>> synonyms = new HashMap<Integer, List<VirtualKey>>(); 
     
    4645 
    4746        if ((existingKeyId != null) && (existingKeyId != keyId)) { 
    48             LOG.finest("virtual key " + virtualKey + 
    49                        " is mapped to more than one key id (current is " + existingKeyId + 
    50                        ", new is " + keyId + "). New key id will be used (" + keyId + ")."); 
     47            Console.traceln(Level.FINEST, "virtual key " + virtualKey + " is mapped to more " + 
     48                            "than one key id (current is " + existingKeyId + ", new is " + keyId + 
     49                           "). New key id will be used (" + keyId + ")."); 
    5150        } 
    5251 
     
    7372        } 
    7473        else { 
    75             LOG.warning("no virtual key define for key id " + keyId); 
     74            Console.traceln(Level.WARNING, "no virtual key define for key id " + keyId); 
    7675            return null; 
    7776        } 
  • trunk/quest-plugin-jfc-test/src/test/java/de/ugoe/cs/quest/plugin/jfc/JFCLogParserTest.java

    r655 r725  
    77import java.util.Collection; 
    88import java.util.List; 
     9import java.util.logging.Level; 
    910 
    1011import org.junit.Before; 
     
    1516import de.ugoe.cs.quest.eventcore.guimodel.IGUIElement; 
    1617import de.ugoe.cs.quest.plugin.jfc.guimodel.JFCGUIElement; 
     18import de.ugoe.cs.util.console.TextConsole; 
    1719 
    1820/** 
     
    2931    @Before 
    3032    public void setUp() { 
    31         // Logger.getLogger("").getHandlers()[0].setFormatter(new SimpleLogFormatter()); 
     33        new TextConsole(Level.FINEST); 
    3234    } 
    3335 
Note: See TracChangeset for help on using the changeset viewer.