001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.transport.logwriters;
018
019import java.io.IOException;
020
021import org.apache.activemq.transport.LogWriter;
022import org.slf4j.Logger;
023
024/**
025 * Implementation of LogWriter interface to keep ActiveMQ's
026 * old logging format.
027 * 
028 * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
029 * 
030 */
031public class DefaultLogWriter implements LogWriter {
032
033    // doc comment inherited from LogWriter
034    public void initialMessage(Logger log) {
035        // Default log writer does nothing here
036    }
037
038    // doc comment inherited from LogWriter
039    public void logRequest (Logger log, Object command) {
040        log.debug("SENDING REQUEST: "+command);
041    }
042
043    // doc comment inherited from LogWriter
044    public void logResponse (Logger log, Object response) {
045        log.debug("GOT RESPONSE: "+response);
046    }
047
048    // doc comment inherited from LogWriter
049    public void logAsyncRequest (Logger log, Object command) {
050        log.debug("SENDING ASNYC REQUEST: "+command);
051    }
052
053    // doc comment inherited from LogWriter
054    public void logOneWay (Logger log, Object command) {
055        log.debug("SENDING: "+command);
056    }
057
058    // doc comment inherited from LogWriter
059    public void logReceivedCommand (Logger log, Object command) {
060        log.debug("RECEIVED: " + command);
061    }
062
063    // doc comment inherited from LogWriter
064    public void logReceivedException (Logger log, IOException error) {
065        log.debug("RECEIVED Exception: "+error, error);
066    }
067
068
069}