* @return OutputStream
   */
  public static OutputStream getLogStream(String module) {
    { Stella_Object streamspec = Stella.lookupLoggingParameter(module, Stella.KWD_STREAM, Stella.STANDARD_OUTPUT);

      { Surrogate testValue000 = Stella_Object.safePrimaryType(streamspec);

        if (Surrogate.subtypeOfStringP(testValue000)) {
          { StringWrapper streamspec000 = ((StringWrapper)(streamspec));

            return (Stella.openOutputFile(streamspec000.wrapperValue, Cons.cons(Stella.KWD_IF_EXISTS, Cons.cons(Stella.KWD_APPEND, Cons.cons(Stella.KWD_IF_NOT_EXISTS, Cons.cons(Stella.KWD_CREATE, Stella.NIL))))));
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_OUTPUT_STREAM)) {
          { OutputStream streamspec000 = ((OutputStream)(streamspec));

            return (streamspec000);
          }
        }
        else {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
            throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
      }
    }
  }