001/* This source code is released under the new BSD license, a copy of the
002 * license is in the distribution directory. */
003
004package mazerob.pc;
005
006import lejos.pc.comm.NXTCommLogListener;
007
008/**
009 * Logger for the Bluetooth communication link.
010 *
011 * <p>It is registered with a {@link mazerob.pc.Robot} instance.</p>
012 *
013 * @author Pedro I. López
014 *
015 */
016class LogListener implements NXTCommLogListener {
017
018    /** Logs Bluetooth connection event.  
019     *
020     * @param message Message to show when logging a Bluetooth
021     *                connection event.
022     */
023    public void logEvent(String message) {
024        System.out.println("PC Log.listener: "+message);
025
026    }
027
028    /** Logs Bluetooth connection exception event. 
029     *
030     * @param throwable Exception thrown by the connection attempt.
031     *
032     * */
033    public void logEvent(Throwable throwable) {
034        System.out.println("PC Log.listener - stack trace: ");
035         throwable.printStackTrace();
036    }
037}