Coverage Report - net.sourceforge.acelogger.EmptyLogger
 
Classes in this File Line Coverage Branch Coverage Complexity
EmptyLogger
23%
6/26
50%
1/2
1,048
 
 1  
 /*
 2  
  * This file is part of AceLogger.
 3  
  * 
 4  
  * AceLogger is free software: you can redistribute it and/or modify it under the terms of the GNU
 5  
  * Lesser General Public License as published by the Free Software Foundation, either version 3 of
 6  
  * the License, or (at your option) any later version.
 7  
  * 
 8  
  * AceLogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 9  
  * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 10  
  * Lesser General Public License for more details.
 11  
  * 
 12  
  * You should have received a copy of the GNU Lesser General Public License along with AceLogger.
 13  
  * If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
 14  
  */
 15  
 package net.sourceforge.acelogger;
 16  
 
 17  
 /**
 18  
  * An implementation of {@link Logger} that does nothing.
 19  
  * 
 20  
  * @author Zardi (https://sourceforge.net/users/daniel_zardi)
 21  
  * @version 1.0.0
 22  
  * @since 1.0.0
 23  
  */
 24  
 public final class EmptyLogger implements Logger {
 25  
 
 26  
         /**
 27  
          * The identifier of this logger.
 28  
          */
 29  
         private String identifier;
 30  
 
 31  
         /**
 32  
          * Constructs a EmptyLogger using the supplied identifier.
 33  
          * 
 34  
          * @param identifier
 35  
          *            The identifier of this logger.
 36  
          * @since 1.0.0
 37  
          */
 38  2
         public EmptyLogger(String identifier) {
 39  2
                 setIdentifier(identifier);
 40  2
         }
 41  
 
 42  
         /** {@inheritDoc} */
 43  
         public String getIdentifier() {
 44  0
                 return identifier;
 45  
         }
 46  
 
 47  
         /**
 48  
          * Sets the string that identifies this object.
 49  
          * 
 50  
          * @param identifier
 51  
          *            The identifier of this object.
 52  
          * @since 1.0.0
 53  
          */
 54  
         private void setIdentifier(String identifier) {
 55  2
                 if (identifier == null) {
 56  0
                         this.identifier = "";
 57  
                 } else {
 58  2
                         this.identifier = identifier;
 59  
                 }
 60  2
         }
 61  
 
 62  
         /** {@inheritDoc} */
 63  
         public boolean isDebugEnabled() {
 64  0
                 return false;
 65  
         }
 66  
 
 67  
         /** {@inheritDoc} */
 68  
         public boolean isErrorEnabled() {
 69  0
                 return false;
 70  
         }
 71  
 
 72  
         /** {@inheritDoc} */
 73  
         public boolean isFatalEnabled() {
 74  0
                 return false;
 75  
         }
 76  
 
 77  
         /** {@inheritDoc} */
 78  
         public boolean isInfoEnabled() {
 79  0
                 return false;
 80  
         }
 81  
 
 82  
         /** {@inheritDoc} */
 83  
         public boolean isTraceEnabled() {
 84  0
                 return false;
 85  
         }
 86  
 
 87  
         /** {@inheritDoc} */
 88  
         public boolean isWarnEnabled() {
 89  0
                 return false;
 90  
         }
 91  
 
 92  
         /** {@inheritDoc} */
 93  
         public void debug(String message, Object... params) {
 94  
                 // REMARK: Intentionally left blank.
 95  0
         }
 96  
 
 97  
         /** {@inheritDoc} */
 98  
         public void debug(String message, Throwable cause, Object... params) {
 99  
                 // REMARK: Intentionally left blank.
 100  0
         }
 101  
 
 102  
         /** {@inheritDoc} */
 103  
         public void error(String message, Object... params) {
 104  
                 // REMARK: Intentionally left blank.
 105  0
         }
 106  
 
 107  
         /** {@inheritDoc} */
 108  
         public void error(String message, Throwable cause, Object... params) {
 109  
                 // REMARK: Intentionally left blank.
 110  0
         }
 111  
 
 112  
         /** {@inheritDoc} */
 113  
         public void fatal(String message, Object... params) {
 114  
                 // REMARK: Intentionally left blank.
 115  0
         }
 116  
 
 117  
         /** {@inheritDoc} */
 118  
         public void fatal(String message, Throwable cause, Object... params) {
 119  
                 // REMARK: Intentionally left blank.
 120  0
         }
 121  
 
 122  
         /** {@inheritDoc} */
 123  
         public void info(String message, Object... params) {
 124  
                 // REMARK: Intentionally left blank.
 125  0
         }
 126  
 
 127  
         /** {@inheritDoc} */
 128  
         public void info(String message, Throwable cause, Object... params) {
 129  
                 // REMARK: Intentionally left blank.
 130  0
         }
 131  
 
 132  
         /** {@inheritDoc} */
 133  
         public void trace(String message, Object... params) {
 134  
                 // REMARK: Intentionally left blank.
 135  0
         }
 136  
 
 137  
         /** {@inheritDoc} */
 138  
         public void trace(String message, Throwable cause, Object... params) {
 139  
                 // REMARK: Intentionally left blank.
 140  0
         }
 141  
 
 142  
         /** {@inheritDoc} */
 143  
         public void warn(String message, Object... params) {
 144  
                 // REMARK: Intentionally left blank.
 145  0
         }
 146  
 
 147  
         /** {@inheritDoc} */
 148  
         public void warn(String message, Throwable cause, Object... params) {
 149  
                 // REMARK: Intentionally left blank.
 150  0
         }
 151  
 
 152  
 }