| Line | Hits | Note | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * $Id: DisplayOptions.java 1299 2009-03-23 20:06:23Z amandel $ | ||
| 3 | * | ||
| 4 | * Copyright 2006, The jCoderZ.org Project. All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions are | ||
| 8 | * met: | ||
| 9 | * | ||
| 10 | * * Redistributions of source code must retain the above copyright | ||
| 11 | * notice, this list of conditions and the following disclaimer. | ||
| 12 | * * Redistributions in binary form must reproduce the above | ||
| 13 | * copyright notice, this list of conditions and the following | ||
| 14 | * disclaimer in the documentation and/or other materials | ||
| 15 | * provided with the distribution. | ||
| 16 | * * Neither the name of the jCoderZ.org Project nor the names of | ||
| 17 | * its contributors may be used to endorse or promote products | ||
| 18 | * derived from this software without specific prior written | ||
| 19 | * permission. | ||
| 20 | * | ||
| 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND | ||
| 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS | ||
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
| 28 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
| 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
| 31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 32 | */ | ||
| 33 | package org.jcoderz.commons.logging; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * This class comprises display options, i.e. which fields are to | ||
| 37 | * display with how many details. | ||
| 38 | * | ||
| 39 | */ | ||
| 40 | 100 | (1) | public final class DisplayOptions |
| 41 | implements Cloneable | ||
| 42 | { | ||
| 43 | 100 | private boolean mDisplayParameters = true; | |
| 44 | 100 | private boolean mDisplaySolution = true; | |
| 45 | 100 | private boolean mDisplayMethod = false; | |
| 46 | 100 | private boolean mDisplayThreadId = false; | |
| 47 | 100 | private boolean mDisplayNodeId = true; | |
| 48 | 100 | private boolean mDisplayInstanceId = true; | |
| 49 | 100 | private boolean mDisplayBusinessImpact = false; | |
| 50 | 100 | private boolean mDisplayCategory = false; | |
| 51 | 100 | private boolean mDisplayLevel = false; | |
| 52 | 100 | private boolean mDisplayTimestamp = false; | |
| 53 | 100 | private boolean mDisplayRecordNumber = false; | |
| 54 | 100 | private boolean mDisplayClass = false; | |
| 55 | 100 | private boolean mDisplaySymbol = true; | |
| 56 | 100 | private boolean mDisplaySymbolId = true; | |
| 57 | 100 | private boolean mDisplayTrackingNumber = true; | |
| 58 | 100 | private boolean mDisplayStackTrace = true; | |
| 59 | 100 | private boolean mDisplayMessageStackTrace = false; | |
| 60 | 100 | private boolean mDisplayTraceLines = false; | |
| 61 | 100 | private boolean mThreadName = false; | |
| 62 | |||
| 63 | /** | ||
| 64 | * Sets the flag whether the thread id is displayed. | ||
| 65 | * | ||
| 66 | * @param display If true, thread id is displayed; if false do not display | ||
| 67 | * the thread id. | ||
| 68 | */ | ||
| 69 | public void displayThreadId (final boolean display) | ||
| 70 | { | ||
| 71 | 0 | mDisplayThreadId = display; | |
| 72 | 0 | } | |
| 73 | |||
| 74 | /** | ||
| 75 | * Gets the flag whether the thread id is displayed. | ||
| 76 | * | ||
| 77 | * @return true if the thread id is to display; false, else. | ||
| 78 | */ | ||
| 79 | public boolean displayThreadId () | ||
| 80 | { | ||
| 81 | 0 | return mDisplayThreadId; | |
| 82 | } | ||
| 83 | |||
| 84 | /** | ||
| 85 | * Sets the flag whether the node id is displayed. | ||
| 86 | * | ||
| 87 | * @param display If true, node id is displayed; if false do not display | ||
| 88 | * the node id. | ||
| 89 | */ | ||
| 90 | public void displayNodeId (final boolean display) | ||
| 91 | { | ||
| 92 | 0 | mDisplayNodeId = display; | |
| 93 | 0 | } | |
| 94 | |||
| 95 | /** | ||
| 96 | * Gets the flag whether the node id is displayed. | ||
| 97 | * | ||
| 98 | * @return true if the node id is to display; false, else. | ||
| 99 | */ | ||
| 100 | public boolean displayNodeId () | ||
| 101 | { | ||
| 102 | 0 | return mDisplayNodeId; | |
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * Sets the flag whether the instance id is displayed. | ||
| 107 | * | ||
| 108 | * @param display If true, instance id is displayed; if false do not display | ||
| 109 | * the instance id. | ||
| 110 | */ | ||
| 111 | public void displayInstanceId (final boolean display) | ||
| 112 | { | ||
| 113 | 0 | mDisplayInstanceId = display; | |
| 114 | 0 | } | |
| 115 | |||
| 116 | /** | ||
| 117 | * Gets the flag whether the instance id is displayed. | ||
| 118 | * | ||
| 119 | * @return true if the instance id is to display; false, else. | ||
| 120 | */ | ||
| 121 | public boolean displayInstanceId () | ||
| 122 | { | ||
| 123 | 0 | return mDisplayInstanceId; | |
| 124 | } | ||
| 125 | |||
| 126 | /** | ||
| 127 | * Sets the flag whether the business impact is displayed. | ||
| 128 | * | ||
| 129 | * @param display If true, business impact is displayed; if false do not | ||
| 130 | * display the business impact. | ||
| 131 | */ | ||
| 132 | public void displayBusinessImpact (final boolean display) | ||
| 133 | { | ||
| 134 | 0 | mDisplayBusinessImpact = display; | |
| 135 | 0 | } | |
| 136 | |||
| 137 | /** | ||
| 138 | * Gets the flag whether the business impact is displayed. | ||
| 139 | * | ||
| 140 | * @return true if the business impact is to display; false, else. | ||
| 141 | */ | ||
| 142 | public boolean displayBusinessImpact () | ||
| 143 | { | ||
| 144 | 0 | return mDisplayBusinessImpact; | |
| 145 | } | ||
| 146 | |||
| 147 | /** | ||
| 148 | * Sets the flag whether the category is displayed. | ||
| 149 | * | ||
| 150 | * @param display If true, category is displayed; if false do not | ||
| 151 | * display the category. | ||
| 152 | */ | ||
| 153 | public void displayCategory (final boolean display) | ||
| 154 | { | ||
| 155 | 0 | mDisplayCategory = display; | |
| 156 | 0 | } | |
| 157 | |||
| 158 | /** | ||
| 159 | * Gets the flag whether the category is displayed. | ||
| 160 | * | ||
| 161 | * @return true if the category is to display; false, else. | ||
| 162 | */ | ||
| 163 | public boolean displayCategory () | ||
| 164 | { | ||
| 165 | 0 | return mDisplayCategory; | |
| 166 | } | ||
| 167 | |||
| 168 | /** | ||
| 169 | * Sets the flag whether the thread name is displayed. | ||
| 170 | * | ||
| 171 | * @param display If true, the thread name is displayed; if false do not | ||
| 172 | * display the thread name. | ||
| 173 | */ | ||
| 174 | public void displayThreadName (final boolean display) | ||
| 175 | { | ||
| 176 | 0 | mThreadName = display; | |
| 177 | 0 | } | |
| 178 | |||
| 179 | /** | ||
| 180 | * Sets the flag whether the thread name should be displayed. | ||
| 181 | * @return true, the thread name is displayed; if false do not | ||
| 182 | * display the thread name. | ||
| 183 | */ | ||
| 184 | public boolean displayThreadName () | ||
| 185 | { | ||
| 186 | 0 | return mThreadName; | |
| 187 | } | ||
| 188 | |||
| 189 | /** | ||
| 190 | * Sets the flag whether the logger level / severity is displayed. | ||
| 191 | * | ||
| 192 | * @param display If true, logger level is displayed; if false do not | ||
| 193 | * display the logger level. | ||
| 194 | */ | ||
| 195 | public void displayLoggerLevel (final boolean display) | ||
| 196 | { | ||
| 197 | 0 | mDisplayLevel = display; | |
| 198 | 0 | } | |
| 199 | |||
| 200 | /** | ||
| 201 | * Gets the flag whether the logger level is displayed. | ||
| 202 | * | ||
| 203 | * @return true if the logger level is to display; false, else. | ||
| 204 | */ | ||
| 205 | public boolean displayLoggerLevel () | ||
| 206 | { | ||
| 207 | 0 | return mDisplayLevel; | |
| 208 | } | ||
| 209 | |||
| 210 | /** | ||
| 211 | * Sets the flag whether the timestamp is displayed. | ||
| 212 | * | ||
| 213 | * @param display If true, timestamp is displayed; if false do not | ||
| 214 | * display the timestamp. | ||
| 215 | */ | ||
| 216 | public void displayTimestamp (final boolean display) | ||
| 217 | { | ||
| 218 | 0 | mDisplayTimestamp = display; | |
| 219 | 0 | } | |
| 220 | |||
| 221 | /** | ||
| 222 | * Gets the flag whether the timestamp is displayed. | ||
| 223 | * | ||
| 224 | * @return true if the timestamp is to display; false, else. | ||
| 225 | */ | ||
| 226 | public boolean displayTimestamp () | ||
| 227 | { | ||
| 228 | 0 | return mDisplayTimestamp; | |
| 229 | } | ||
| 230 | |||
| 231 | /** | ||
| 232 | * Sets the flag whether the record number of a log file record is displayed. | ||
| 233 | * | ||
| 234 | * @param display If true, record number is displayed; if false do not | ||
| 235 | * display the record number. | ||
| 236 | */ | ||
| 237 | public void displayRecordNumber (final boolean display) | ||
| 238 | { | ||
| 239 | 0 | mDisplayRecordNumber = display; | |
| 240 | 0 | } | |
| 241 | |||
| 242 | /** | ||
| 243 | * Gets the flag whether the record number is displayed. | ||
| 244 | * | ||
| 245 | * @return true if the record number is to display; false, else. | ||
| 246 | */ | ||
| 247 | public boolean displayRecordNumber () | ||
| 248 | { | ||
| 249 | 0 | return mDisplayRecordNumber; | |
| 250 | } | ||
| 251 | |||
| 252 | /** | ||
| 253 | * Sets the flag whether the source class, where the message was logged, is | ||
| 254 | * displayed. | ||
| 255 | * | ||
| 256 | * @param display If true, source class is displayed; if false do not | ||
| 257 | * display the source class. | ||
| 258 | */ | ||
| 259 | public void displaySourceClass (final boolean display) | ||
| 260 | { | ||
| 261 | 0 | mDisplayClass = display; | |
| 262 | 0 | } | |
| 263 | |||
| 264 | /** | ||
| 265 | * Gets the flag whether the source class name is displayed. | ||
| 266 | * | ||
| 267 | * @return true if the source class name is to display; false, else. | ||
| 268 | */ | ||
| 269 | public boolean displaySourceClass () | ||
| 270 | { | ||
| 271 | 0 | return mDisplayClass; | |
| 272 | } | ||
| 273 | |||
| 274 | /** | ||
| 275 | * Sets the flag whether the source method, where the message was logged, is | ||
| 276 | * displayed. | ||
| 277 | * | ||
| 278 | * @param display If true, source method is displayed; if false do not | ||
| 279 | * display the source method. | ||
| 280 | */ | ||
| 281 | public void displaySourceMethod (final boolean display) | ||
| 282 | { | ||
| 283 | 0 | mDisplayMethod = display; | |
| 284 | 0 | } | |
| 285 | |||
| 286 | /** | ||
| 287 | * Gets the flag whether the source method name is displayed. | ||
| 288 | * | ||
| 289 | * @return true if the source method name is to display; false, else. | ||
| 290 | */ | ||
| 291 | public boolean displaySourceMethod () | ||
| 292 | { | ||
| 293 | 0 | return mDisplayMethod; | |
| 294 | } | ||
| 295 | |||
| 296 | /** | ||
| 297 | * Sets the flag whether the possible solution for a message is displayed. | ||
| 298 | * | ||
| 299 | * @param display If true, solution is displayed; if false do not | ||
| 300 | * display the solution. | ||
| 301 | */ | ||
| 302 | public void displaySolution (final boolean display) | ||
| 303 | { | ||
| 304 | 0 | mDisplaySolution = display; | |
| 305 | 0 | } | |
| 306 | |||
| 307 | /** | ||
| 308 | * Gets the flag whether the possible solution is displayed. | ||
| 309 | * | ||
| 310 | * @return true if the solution is to display; false, else. | ||
| 311 | */ | ||
| 312 | public boolean displaySolution () | ||
| 313 | { | ||
| 314 | 0 | return mDisplaySolution; | |
| 315 | } | ||
| 316 | |||
| 317 | /** | ||
| 318 | * Sets the flag whether the parameters for a message are displayed. | ||
| 319 | * | ||
| 320 | * @param display If true, parameters are displayed; if false do not | ||
| 321 | * display the parameters. | ||
| 322 | */ | ||
| 323 | public void displayParameters (final boolean display) | ||
| 324 | { | ||
| 325 | 0 | mDisplayParameters = display; | |
| 326 | 0 | } | |
| 327 | |||
| 328 | /** | ||
| 329 | * Gets the flag whether the parameters are displayed. | ||
| 330 | * | ||
| 331 | * @return true if the parameters are to display; false, else. | ||
| 332 | */ | ||
| 333 | public boolean displayParameters () | ||
| 334 | { | ||
| 335 | 0 | return mDisplayParameters; | |
| 336 | } | ||
| 337 | |||
| 338 | /** | ||
| 339 | * Sets the flag whether the symbol is displayed. | ||
| 340 | * | ||
| 341 | * @param display If true, the symbol is displayed; if false do not | ||
| 342 | * display the symbol. | ||
| 343 | */ | ||
| 344 | public void displaySymbol (final boolean display) | ||
| 345 | { | ||
| 346 | 0 | mDisplaySymbol = display; | |
| 347 | 0 | } | |
| 348 | |||
| 349 | /** | ||
| 350 | * Gets the flag whether the symbol is displayed. | ||
| 351 | * | ||
| 352 | * @return true if the symbol is to display; false, else. | ||
| 353 | */ | ||
| 354 | public boolean displaySymbol () | ||
| 355 | { | ||
| 356 | 0 | return mDisplaySymbol; | |
| 357 | } | ||
| 358 | |||
| 359 | /** | ||
| 360 | * Sets the flag whether the symbol id is displayed. | ||
| 361 | * | ||
| 362 | * @param display If true, the symbol id is displayed; if false do not | ||
| 363 | * display the symbol id. | ||
| 364 | */ | ||
| 365 | public void displaySymbolId (final boolean display) | ||
| 366 | { | ||
| 367 | 0 | mDisplaySymbolId = display; | |
| 368 | 0 | } | |
| 369 | |||
| 370 | /** | ||
| 371 | * Gets the flag whether the symbol id is displayed. | ||
| 372 | * | ||
| 373 | * @return true if the symbol id is to display; false, else. | ||
| 374 | */ | ||
| 375 | public boolean displaySymbolId () | ||
| 376 | { | ||
| 377 | 0 | return mDisplaySymbolId; | |
| 378 | } | ||
| 379 | |||
| 380 | /** | ||
| 381 | * Sets the flag whether the sequence of tracking numbers is displayed. | ||
| 382 | * | ||
| 383 | * @param display If true, the sequence of tracking numbers is displayed; | ||
| 384 | * if false do not display the sequence of tracking numbers. | ||
| 385 | */ | ||
| 386 | public void displayTrackingNumber (final boolean display) | ||
| 387 | { | ||
| 388 | 0 | mDisplayTrackingNumber = display; | |
| 389 | 0 | } | |
| 390 | |||
| 391 | /** | ||
| 392 | * Gets the flag whether the sequence of tracking numbers is displayed. | ||
| 393 | * | ||
| 394 | * @return true if the sequence of tracking numbers is to display; | ||
| 395 | * false, else. | ||
| 396 | */ | ||
| 397 | public boolean displayTrackingNumber () | ||
| 398 | { | ||
| 399 | 0 | return mDisplayTrackingNumber; | |
| 400 | } | ||
| 401 | |||
| 402 | /** | ||
| 403 | * Sets the flag whether the stack trace of an exception is displayed. | ||
| 404 | * | ||
| 405 | * @param display If true, the stacktrace of an exception is displayed; | ||
| 406 | * if false do not display an exception's stacktrace. | ||
| 407 | */ | ||
| 408 | public void displayStackTrace (final boolean display) | ||
| 409 | { | ||
| 410 | 0 | mDisplayStackTrace = display; | |
| 411 | 0 | } | |
| 412 | |||
| 413 | /** | ||
| 414 | * Gets the flag whether an exception's stacktrace is displayed. | ||
| 415 | * | ||
| 416 | * @return true if the stacktrace of an exception is to display; false, else. | ||
| 417 | */ | ||
| 418 | public boolean displayStackTrace () | ||
| 419 | { | ||
| 420 | 100 | return mDisplayStackTrace; | |
| 421 | } | ||
| 422 | |||
| 423 | /** | ||
| 424 | * Sets the flag whether the stack trace of a log message is displayed. | ||
| 425 | * | ||
| 426 | * @param display If true, the stacktrace of a log message is displayed; | ||
| 427 | * if false do not display a log message's stacktrace. | ||
| 428 | */ | ||
| 429 | public void displayMessageStackTrace (final boolean display) | ||
| 430 | { | ||
| 431 | 0 | mDisplayMessageStackTrace = display; | |
| 432 | 0 | } | |
| 433 | |||
| 434 | /** | ||
| 435 | * Gets the flag whether a log message's stacktrace is displayed. | ||
| 436 | * | ||
| 437 | * @return true if the stacktrace of an log message is to display; | ||
| 438 | * false, else. | ||
| 439 | */ | ||
| 440 | public boolean displayMessageStackTrace () | ||
| 441 | { | ||
| 442 | 100 | return mDisplayMessageStackTrace; | |
| 443 | } | ||
| 444 | |||
| 445 | /** | ||
| 446 | * Sets the flag whether standard trace logs are displayed, i.e. undeclared | ||
| 447 | * log messages, which are generated by standard logger api calls. | ||
| 448 | * | ||
| 449 | * @param display If true, standard trace logs are displayed; | ||
| 450 | * if false do not display standard trace logs. | ||
| 451 | */ | ||
| 452 | public void displayTraceLines (final boolean display) | ||
| 453 | { | ||
| 454 | 0 | mDisplayTraceLines = display; | |
| 455 | 0 | } | |
| 456 | |||
| 457 | /** | ||
| 458 | * Gets the flag whether standard trace logs are displayed, i.e. undeclared | ||
| 459 | * log messages, which are generated by standard logger api calls. | ||
| 460 | * | ||
| 461 | * @return true if trace logs are to display; false, else. | ||
| 462 | */ | ||
| 463 | public boolean displayTraceLines () | ||
| 464 | { | ||
| 465 | 0 | return mDisplayTraceLines; | |
| 466 | } | ||
| 467 | |||
| 468 | /** {@inheritDoc} */ | ||
| 469 | public Object clone () | ||
| 470 | throws CloneNotSupportedException | ||
| 471 | { | ||
| 472 | 0 | return super.clone(); | |
| 473 | } | ||
| 474 | } |
|
|
(1) | 40 | : | 0 | Type Javadoc comment is missing an @author tag. |