com.ptc.windchill.structconf.util
Class Verbosity

java.lang.Object
  extended bycom.ptc.windchill.structconf.util.Verbosity

public final class Verbosity
extends Object

Utility to control verbosity of output for structured configuration code at the thread local level, rather than rely upon a static final constant that cannot be changed. Thread localness is important for being able to create a long running server that can be made more verbose in order to diagnose problems without requiring a process restart.


Field Summary
static int DEBUG_VERBOSE
          Obnoxious developer oriented debug output.
static int DEFAULT
          Default value - silent unless there are problems.
static int VERBOSE
          Basic, consumer oriented output.
private static InheritableThreadLocal verbosity_
           
 
Constructor Summary
private Verbosity()
           
 
Method Summary
static boolean debugVerbose()
          Whether or not the thread's verbosity level is DEBUG_VERBOSE
static void error(String message)
           
static void error(String[] messages)
           
static void error(String message, Throwable t)
           
static void error(Throwable t)
           
private static String getMessage(Throwable t)
           
private static int getVerbosity()
           
static void inform(String message)
           
static void inform(String[] messages)
           
static void informAlways(String message)
           
private static void log(Throwable t, PrintStream ps)
          Just show the message if verbosity is DEFAULT, and print stack trace if it is VERBOSE or higher.
private static void log(Throwable t, PrintWriter pw)
          Just show the message if verbosity is DEFAULT, and print stack trace if it is VERBOSE or higher.
static void setVerbosity(int level)
          Change the verbosity level
static boolean verbose()
          Whether or not the thread's verbosity level is VERBOSE or higher.
static void warn(String message)
           
static void warn(String[] messages)
           
static void warn(String message, Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static int DEFAULT
Default value - silent unless there are problems.


VERBOSE

public static int VERBOSE
Basic, consumer oriented output.


DEBUG_VERBOSE

public static int DEBUG_VERBOSE
Obnoxious developer oriented debug output.


verbosity_

private static final InheritableThreadLocal verbosity_
Constructor Detail

Verbosity

private Verbosity()
Method Detail

setVerbosity

public static final void setVerbosity(int level)
Change the verbosity level


getVerbosity

private static final int getVerbosity()

verbose

public static final boolean verbose()
Whether or not the thread's verbosity level is VERBOSE or higher.


debugVerbose

public static final boolean debugVerbose()
Whether or not the thread's verbosity level is DEBUG_VERBOSE


getMessage

private static String getMessage(Throwable t)

informAlways

public static final void informAlways(String message)

inform

public static final void inform(String message)

inform

public static final void inform(String[] messages)

warn

public static final void warn(String message)

warn

public static final void warn(String[] messages)

warn

public static final void warn(String message,
                              Throwable t)

error

public static final void error(String message)

error

public static final void error(String[] messages)

error

public static final void error(Throwable t)

error

public static final void error(String message,
                               Throwable t)

log

private static final void log(Throwable t,
                              PrintStream ps)
Just show the message if verbosity is DEFAULT, and print stack trace if it is VERBOSE or higher.


log

private static final void log(Throwable t,
                              PrintWriter pw)
Just show the message if verbosity is DEFAULT, and print stack trace if it is VERBOSE or higher.