ur_rna.Utilities

## Class AppLog

- java.lang.Object
- - ur_rna.Utilities.AppLog

-     public class AppLog
      extends java.lang.Object

  A utility class to streamline and standardize logging across applications.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.HashMap<java.io.File,java.io.PrintStream>` | `_customStreams`
    `protected Verbosity` | `_requiredVerbosity`
    `private static AppLog` | `defaultAppLog`
    `static Verbosity` | `DefaultLogImportance`
    `private boolean[]` | `forceEnabled`
    `protected static java.io.PrintStream` | `nullStream`
    `private java.io.PrintStream[]` | `streams`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AppLog()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `debug(java.lang.String s)`
    `void` | `debug(java.lang.String format, java.lang.Object... args)`
    `void` | `error(java.lang.String s)`
    `void` | `error(java.lang.String format, java.lang.Object... args)`
    `void` | `error(java.lang.String s, java.lang.Throwable e)`
    `private java.io.PrintStream` | `getCustomStream(java.lang.String path)`
    `java.io.PrintStream` | `getDbgStream()`
    `static AppLog` | `getDefault()`
    `static java.lang.String` | `getErrorInfo(java.lang.Throwable t)`
    `java.io.PrintStream` | `getErrStream()`
    `java.io.PrintStream` | `getStream(Verbosity streamVerbosity)`
    `static java.lang.String` | `getSysProp(java.lang.String... possibleKeys)` Checks for the existence of a system property in multiple places.
    `static java.lang.String` | `getSysProp(java.lang.String key)`
    `java.io.PrintStream` | `getTrStream()`
    `Verbosity` | `getVerbosity()` Returns the log-level (aka importance or verbosity) required for log entries to be processed.
    `void` | `info(java.lang.String s)`
    `void` | `info(java.lang.String format, java.lang.Object... args)`
    `boolean` | `isDebugEnabled()` Returns true if Debug log messages are enabled, either via the current Verbosity setting or by force-enabling them specifically (e.g.
    `boolean` | `isEnabled(int verbosity)` Returns true if the specified log-level is enabled, either via the current Verbosity setting or by force-enabling the specific log-level (e.g.
    `boolean` | `isEnabled(Verbosity verbosity)` Returns true if the specified log-level is enabled, either via the current Verbosity setting or by force-enabling the specific log-level (e.g.
    `boolean` | `isEnabledSpecial(Verbosity verbosity)` Returns true if the specified log-level has been force-enabled (e.g.
    `boolean` | `isTraceEnabled()` Returns true if Trace log messages are enabled, either via the current Verbosity setting or by force-enabling them specifically (e.g.
    `void` | `log(java.lang.String s)`
    `void` | `log(java.lang.String format, java.lang.Object... args)`
    `void` | `log(java.lang.String s, Verbosity messageVerbosity)`
    `private void` | `logFmt(java.lang.String format, Verbosity importance, java.lang.Object... args)`
    `void` | `readSystemProperties()`
    `static void` | `setDefault(AppLog defLog)`
    `void` | `setEnabledSpecial(Verbosity verbosity, boolean enabled)`
    `void` | `setStream(Verbosity streamVerbosity, java.io.PrintStream stream)`
    `void` | `setVerbosity(int value)`
    `void` | `setVerbosity(Verbosity value)`
    `void` | `trace(java.lang.String s)`
    `void` | `trace(java.lang.String format, java.lang.Object... args)`
    `void` | `warn(java.lang.String s)`
    `void` | `warn(java.lang.String format, java.lang.Object... args)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _customStreams

          private java.util.HashMap<java.io.File,java.io.PrintStream> _customStreams

    - #### _requiredVerbosity

          protected Verbosity _requiredVerbosity

    - #### defaultAppLog

          private static AppLog defaultAppLog

    - #### DefaultLogImportance

          public static Verbosity DefaultLogImportance

    - #### forceEnabled

          private boolean[] forceEnabled

    - #### nullStream

          protected static java.io.PrintStream nullStream

    - #### streams

          private java.io.PrintStream[] streams

  - ### Constructor Detail

    - #### AppLog

          public AppLog()

  - ### Method Detail

    - #### debug

          public void debug(java.lang.String s)

    - #### debug

          public void debug(java.lang.String format,
                            java.lang.Object... args)

    - #### error

          public void error(java.lang.String s)

    - #### error

          public void error(java.lang.String format,
                            java.lang.Object... args)

    - #### error

          public void error(java.lang.String s,
                            java.lang.Throwable e)

    - #### getCustomStream

          private java.io.PrintStream getCustomStream(java.lang.String path)

    - #### getDbgStream

          public java.io.PrintStream getDbgStream()

    - #### getDefault

          public static AppLog getDefault()

    - #### getErrorInfo

          public static java.lang.String getErrorInfo(java.lang.Throwable t)

    - #### getErrStream

          public java.io.PrintStream getErrStream()

    - #### getStream

          public java.io.PrintStream getStream(Verbosity streamVerbosity)

    - #### getSysProp

          public static java.lang.String getSysProp(java.lang.String... possibleKeys)

      Checks for the existence of a system property in multiple places. 1) System.getProperty(key) 2) System.getenv(key) 3) System.getenv(APPNAME_key) Upper/lower case is also checked for getenv. If key contains hyphens, they are converted to underscores for getenv.

    - #### getSysProp

          public static java.lang.String getSysProp(java.lang.String key)

    - #### getTrStream

          public java.io.PrintStream getTrStream()

    - #### getVerbosity

          public Verbosity getVerbosity()

      Returns the log-level (aka importance or verbosity) required for log entries to be processed. Log entries with importance lower than this will be ignored (unless they are force-enabled).

    - #### info

          public void info(java.lang.String s)

    - #### info

          public void info(java.lang.String format,
                           java.lang.Object... args)

    - #### isDebugEnabled

          public boolean isDebugEnabled()

      Returns true if Debug log messages are enabled, either via the current Verbosity setting or by force-enabling them specifically (e.g. via `setEnabledSpecial(Verbosity, boolean)`.
      Returns:
        True if Debug is enabled (by any means).

    - #### isEnabled

          public boolean isEnabled(int verbosity)

      Returns true if the specified log-level is enabled, either via the current Verbosity setting or by force-enabling the specific log-level (e.g. via `setEnabledSpecial(Verbosity, boolean)`.
      Parameters:
        `verbosity` - The log-level to check.
      Returns:
        True if the specified log-level is enabled (by any means).

    - #### isEnabled

          public boolean isEnabled(Verbosity verbosity)

      Returns true if the specified log-level is enabled, either via the current Verbosity setting or by force-enabling the specific log-level (e.g. via `setEnabledSpecial(Verbosity, boolean)`.
      Parameters:
        `verbosity` - The log-level to check.
      Returns:
        True if the specified log-level is enabled (by any means).

    - #### isEnabledSpecial

          public boolean isEnabledSpecial(Verbosity verbosity)

      Returns true if the specified log-level has been force-enabled (e.g. via `setEnabledSpecial(Verbosity, boolean)`. Note that this log-level may be enabled by the Verbosity setting, regardless of whether it has been force-enabled.
      Parameters:
        `verbosity` - The log-level to check.
      Returns:
        True if the specified log-level is force-enabled.

    - #### isTraceEnabled

          public boolean isTraceEnabled()

      Returns true if Trace log messages are enabled, either via the current Verbosity setting or by force-enabling them specifically (e.g. via `setEnabledSpecial(Verbosity, boolean)`.
      Returns:
        True if Trace is enabled (by any means).

    - #### log

          public void log(java.lang.String s)

    - #### log

          public void log(java.lang.String format,
                          java.lang.Object... args)

    - #### log

          public void log(java.lang.String s,
                          Verbosity messageVerbosity)

    - #### logFmt

          private void logFmt(java.lang.String format,
                              Verbosity importance,
                              java.lang.Object... args)

    - #### readSystemProperties

          public void readSystemProperties()

    - #### setDefault

          public static void setDefault(AppLog defLog)

    - #### setEnabledSpecial

          public void setEnabledSpecial(Verbosity verbosity,
                                        boolean enabled)

    - #### setStream

          public void setStream(Verbosity streamVerbosity,
                                java.io.PrintStream stream)

    - #### setVerbosity

          public void setVerbosity(int value)
                            throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### setVerbosity

          public void setVerbosity(Verbosity value)
                            throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### trace

          public void trace(java.lang.String s)

    - #### trace

          public void trace(java.lang.String format,
                            java.lang.Object... args)

    - #### warn

          public void warn(java.lang.String s)

    - #### warn

          public void warn(java.lang.String format,
                           java.lang.Object... args)