1 2 /* 3 * ==================================================================== 4 * The Apache Software License, Version 1.1 5 * 6 * Copyright (c) 2002 The Apache Software Foundation. All rights 7 * reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in 18 * the documentation and/or other materials provided with the 19 * distribution. 20 * 21 * 3. The end-user documentation included with the redistribution, 22 * if any, must include the following acknowledgment: 23 * "This product includes software developed by the 24 * Apache Software Foundation (http://www.apache.org/)." 25 * Alternately, this acknowledgment may appear in the software itself, 26 * if and wherever such third-party acknowledgments normally appear. 27 * 28 * 4. The names "Apache" and "Apache Software Foundation" and 29 * "Apache POI" must not be used to endorse or promote products 30 * derived from this software without prior written permission. For 31 * written permission, please contact apache@apache.org. 32 * 33 * 5. Products derived from this software may not be called "Apache", 34 * "Apache POI", nor may "Apache" appear in their name, without 35 * prior written permission of the Apache Software Foundation. 36 * 37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 48 * SUCH DAMAGE. 49 * ==================================================================== 50 * 51 * This software consists of voluntary contributions made by many 52 * individuals on behalf of the Apache Software Foundation. For more 53 * information on the Apache Software Foundation, please see 54 * <http://www.apache.org/>. 55 */ 56 package org.apache.poi.util; 57 58 import java.util.*; 59 60 /** 61 * A logger class that strives to make it as easy as possible for 62 * developers to write log calls, while simultaneously making those 63 * calls as cheap as possible by performing lazy evaluation of the log 64 * message.<p> 65 * 66 * @author Marc Johnson (mjohnson at apache dot org) 67 * @author Glen Stampoultzis (glens at apache.org) 68 * @author Nicola Ken Barozzi (nicolaken at apache.org) 69 */ 70 71 public class NullLogger extends POILogger 72 { 73 public void initialize(final String cat) 74 { 75 //do nothing 76 } 77 78 /** 79 * Log a message 80 * 81 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 82 * @param obj1 The object to log. 83 */ 84 85 public void log(final int level, final Object obj1) 86 { 87 //do nothing 88 } 89 90 /** 91 * Check if a logger is enabled to log at the specified level 92 * 93 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 94 * @param obj1 The logger to check. 95 */ 96 97 public boolean check(final int level) 98 { 99 return false; 100 } 101 102 /** 103 * Log a message. Lazily appends Object parameters together. 104 * 105 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 106 * @param obj1 first object to place in the message 107 * @param obj2 second object to place in the message 108 */ 109 110 public void log(final int level, final Object obj1, final Object obj2) 111 { 112 //do nothing 113 } 114 115 /** 116 * Log a message. Lazily appends Object parameters together. 117 * 118 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 119 * @param obj1 first Object to place in the message 120 * @param obj2 second Object to place in the message 121 * @param obj3 third Object to place in the message 122 */ 123 124 public void log(final int level, final Object obj1, final Object obj2, 125 final Object obj3) 126 { 127 //do nothing 128 } 129 130 /** 131 * Log a message. Lazily appends Object parameters together. 132 * 133 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 134 * @param obj1 first Object to place in the message 135 * @param obj2 second Object to place in the message 136 * @param obj3 third Object to place in the message 137 * @param obj4 fourth Object to place in the message 138 */ 139 140 public void log(final int level, final Object obj1, final Object obj2, 141 final Object obj3, final Object obj4) 142 { 143 //do nothing 144 } 145 146 /** 147 * Log a message. Lazily appends Object parameters together. 148 * 149 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 150 * @param obj1 first Object to place in the message 151 * @param obj2 second Object to place in the message 152 * @param obj3 third Object to place in the message 153 * @param obj4 fourth Object to place in the message 154 * @param obj5 fifth Object to place in the message 155 */ 156 157 public void log(final int level, final Object obj1, final Object obj2, 158 final Object obj3, final Object obj4, final Object obj5) 159 { 160 //do nothing 161 } 162 163 /** 164 * Log a message. Lazily appends Object parameters together. 165 * 166 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 167 * @param obj1 first Object to place in the message 168 * @param obj2 second Object to place in the message 169 * @param obj3 third Object to place in the message 170 * @param obj4 fourth Object to place in the message 171 * @param obj5 fifth Object to place in the message 172 * @param obj6 sixth Object to place in the message 173 */ 174 175 public void log(final int level, final Object obj1, final Object obj2, 176 final Object obj3, final Object obj4, final Object obj5, 177 final Object obj6) 178 { 179 //do nothing 180 } 181 182 /** 183 * Log a message. Lazily appends Object parameters together. 184 * 185 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 186 * @param obj1 first Object to place in the message 187 * @param obj2 second Object to place in the message 188 * @param obj3 third Object to place in the message 189 * @param obj4 fourth Object to place in the message 190 * @param obj5 fifth Object to place in the message 191 * @param obj6 sixth Object to place in the message 192 * @param obj7 seventh Object to place in the message 193 */ 194 195 public void log(final int level, final Object obj1, final Object obj2, 196 final Object obj3, final Object obj4, final Object obj5, 197 final Object obj6, final Object obj7) 198 { 199 //do nothing 200 } 201 202 /** 203 * Log a message. Lazily appends Object parameters together. 204 * 205 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 206 * @param obj1 first Object to place in the message 207 * @param obj2 second Object to place in the message 208 * @param obj3 third Object to place in the message 209 * @param obj4 fourth Object to place in the message 210 * @param obj5 fifth Object to place in the message 211 * @param obj6 sixth Object to place in the message 212 * @param obj7 seventh Object to place in the message 213 * @param obj8 eighth Object to place in the message 214 */ 215 216 public void log(final int level, final Object obj1, final Object obj2, 217 final Object obj3, final Object obj4, final Object obj5, 218 final Object obj6, final Object obj7, final Object obj8) 219 { 220 //do nothing 221 } 222 223 /** 224 * Log a message 225 * 226 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 227 * @param obj1 The object to log. This is converted to a string. 228 * @param exception An exception to be logged 229 */ 230 231 public void log(final int level, final Object obj1, 232 final Throwable exception) 233 { 234 //do nothing 235 } 236 237 /** 238 * Log a message. Lazily appends Object parameters together. 239 * 240 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 241 * @param obj1 first Object to place in the message 242 * @param obj2 second Object to place in the message 243 * @param exception An exception to be logged 244 */ 245 246 public void log(final int level, final Object obj1, final Object obj2, 247 final Throwable exception) 248 { 249 //do nothing 250 } 251 252 /** 253 * Log a message. Lazily appends Object parameters together. 254 * 255 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 256 * @param obj1 first Object to place in the message 257 * @param obj2 second Object to place in the message 258 * @param obj3 third object to place in the message 259 * @param exception An error message to be logged 260 */ 261 262 public void log(final int level, final Object obj1, final Object obj2, 263 final Object obj3, final Throwable exception) 264 { 265 //do nothing 266 } 267 268 /** 269 * Log a message. Lazily appends Object parameters together. 270 * 271 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 272 * @param obj1 first Object to place in the message 273 * @param obj2 second Object to place in the message 274 * @param obj3 third object to place in the message 275 * @param obj4 fourth object to place in the message 276 * @param exception An exception to be logged 277 */ 278 279 public void log(final int level, final Object obj1, final Object obj2, 280 final Object obj3, final Object obj4, 281 final Throwable exception) 282 { 283 //do nothing 284 } 285 286 /** 287 * Log a message. Lazily appends Object parameters together. 288 * 289 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 290 * @param obj1 first Object to place in the message 291 * @param obj2 second Object to place in the message 292 * @param obj3 third object to place in the message 293 * @param obj4 fourth object to place in the message 294 * @param obj5 fifth object to place in the message 295 * @param exception An exception to be logged 296 */ 297 298 public void log(final int level, final Object obj1, final Object obj2, 299 final Object obj3, final Object obj4, final Object obj5, 300 final Throwable exception) 301 { 302 //do nothing 303 } 304 305 /** 306 * Log a message. Lazily appends Object parameters together. 307 * 308 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 309 * @param obj1 first Object to place in the message 310 * @param obj2 second Object to place in the message 311 * @param obj3 third object to place in the message 312 * @param obj4 fourth object to place in the message 313 * @param obj5 fifth object to place in the message 314 * @param obj6 sixth object to place in the message 315 * @param exception An exception to be logged 316 */ 317 318 public void log(final int level, final Object obj1, final Object obj2, 319 final Object obj3, final Object obj4, final Object obj5, 320 final Object obj6, final Throwable exception) 321 { 322 //do nothing 323 } 324 325 /** 326 * Log a message. Lazily appends Object parameters together. 327 * 328 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 329 * @param obj1 first Object to place in the message 330 * @param obj2 second Object to place in the message 331 * @param obj3 third object to place in the message 332 * @param obj4 fourth object to place in the message 333 * @param obj5 fifth object to place in the message 334 * @param obj6 sixth object to place in the message 335 * @param obj7 seventh object to place in the message 336 * @param exception An exception to be logged 337 */ 338 339 public void log(final int level, final Object obj1, final Object obj2, 340 final Object obj3, final Object obj4, final Object obj5, 341 final Object obj6, final Object obj7, 342 final Throwable exception) 343 { 344 //do nothing 345 } 346 347 /** 348 * Log a message. Lazily appends Object parameters together. 349 * 350 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 351 * @param obj1 first Object to place in the message 352 * @param obj2 second Object to place in the message 353 * @param obj3 third object to place in the message 354 * @param obj4 fourth object to place in the message 355 * @param obj5 fifth object to place in the message 356 * @param obj6 sixth object to place in the message 357 * @param obj7 seventh object to place in the message 358 * @param obj8 eighth object to place in the message 359 * @param exception An exception to be logged 360 */ 361 362 public void log(final int level, final Object obj1, final Object obj2, 363 final Object obj3, final Object obj4, final Object obj5, 364 final Object obj6, final Object obj7, final Object obj8, 365 final Throwable exception) 366 { 367 //do nothing 368 } 369 370 /** 371 * Logs a formated message. The message itself may contain % 372 * characters as place holders. This routine will attempt to match 373 * the placeholder by looking at the type of parameter passed to 374 * obj1.<p> 375 * 376 * If the parameter is an array, it traverses the array first and 377 * matches parameters sequentially against the array items. 378 * Otherwise the parameters after <code>message</code> are matched 379 * in order.<p> 380 * 381 * If the place holder matches against a number it is printed as a 382 * whole number. This can be overridden by specifying a precision 383 * in the form %n.m where n is the padding for the whole part and 384 * m is the number of decimal places to display. n can be excluded 385 * if desired. n and m may not be more than 9.<p> 386 * 387 * If the last parameter (after flattening) is a Throwable it is 388 * logged specially. 389 * 390 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 391 * @param message The message to log. 392 * @param obj1 The first object to match against. 393 */ 394 395 public void logFormatted(final int level, final String message, 396 final Object obj1) 397 { 398 //do nothing 399 } 400 401 /** 402 * Logs a formated message. The message itself may contain % 403 * characters as place holders. This routine will attempt to match 404 * the placeholder by looking at the type of parameter passed to 405 * obj1.<p> 406 * 407 * If the parameter is an array, it traverses the array first and 408 * matches parameters sequentially against the array items. 409 * Otherwise the parameters after <code>message</code> are matched 410 * in order.<p> 411 * 412 * If the place holder matches against a number it is printed as a 413 * whole number. This can be overridden by specifying a precision 414 * in the form %n.m where n is the padding for the whole part and 415 * m is the number of decimal places to display. n can be excluded 416 * if desired. n and m may not be more than 9.<p> 417 * 418 * If the last parameter (after flattening) is a Throwable it is 419 * logged specially. 420 * 421 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 422 * @param message The message to log. 423 * @param obj1 The first object to match against. 424 * @param obj2 The second object to match against. 425 */ 426 427 public void logFormatted(final int level, final String message, 428 final Object obj1, final Object obj2) 429 { 430 //do nothing 431 } 432 433 /** 434 * Logs a formated message. The message itself may contain % 435 * characters as place holders. This routine will attempt to match 436 * the placeholder by looking at the type of parameter passed to 437 * obj1.<p> 438 * 439 * If the parameter is an array, it traverses the array first and 440 * matches parameters sequentially against the array items. 441 * Otherwise the parameters after <code>message</code> are matched 442 * in order.<p> 443 * 444 * If the place holder matches against a number it is printed as a 445 * whole number. This can be overridden by specifying a precision 446 * in the form %n.m where n is the padding for the whole part and 447 * m is the number of decimal places to display. n can be excluded 448 * if desired. n and m may not be more than 9.<p> 449 * 450 * If the last parameter (after flattening) is a Throwable it is 451 * logged specially. 452 * 453 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 454 * @param message The message to log. 455 * @param obj1 The first object to match against. 456 * @param obj2 The second object to match against. 457 * @param obj3 The third object to match against. 458 */ 459 460 public void logFormatted(final int level, final String message, 461 final Object obj1, final Object obj2, 462 final Object obj3) 463 { 464 //do nothing 465 } 466 467 /** 468 * Logs a formated message. The message itself may contain % 469 * characters as place holders. This routine will attempt to match 470 * the placeholder by looking at the type of parameter passed to 471 * obj1.<p> 472 * 473 * If the parameter is an array, it traverses the array first and 474 * matches parameters sequentially against the array items. 475 * Otherwise the parameters after <code>message</code> are matched 476 * in order.<p> 477 * 478 * If the place holder matches against a number it is printed as a 479 * whole number. This can be overridden by specifying a precision 480 * in the form %n.m where n is the padding for the whole part and 481 * m is the number of decimal places to display. n can be excluded 482 * if desired. n and m may not be more than 9.<p> 483 * 484 * If the last parameter (after flattening) is a Throwable it is 485 * logged specially. 486 * 487 * @param level One of DEBUG, INFO, WARN, ERROR, FATAL 488 * @param message The message to log. 489 * @param obj1 The first object to match against. 490 * @param obj2 The second object to match against. 491 * @param obj3 The third object to match against. 492 * @param obj4 The forth object to match against. 493 */ 494 495 public void logFormatted(final int level, final String message, 496 final Object obj1, final Object obj2, 497 final Object obj3, final Object obj4) 498 { 499 //do nothing 500 } 501 502 } 503 504